summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2007-04-24 10:59:21 +0000
committerkib <kib@FreeBSD.org>2007-04-24 10:59:21 +0000
commit543a201e4b11d37d8d2441b8268a51ddaa168592 (patch)
treee40220c131895b0639b5d3f9849ca730c0e096a6 /sys/kern
parent67b5103f2993df28870c0a2060a3e0955cfcc7a5 (diff)
downloadFreeBSD-src-543a201e4b11d37d8d2441b8268a51ddaa168592.zip
FreeBSD-src-543a201e4b11d37d8d2441b8268a51ddaa168592.tar.gz
Disable nesting of BOP_BDFLUSH(). VOP_FSYNC() call in bdwrite() could
result in bdwrite() being reentered, thus causing infinite recursion. Reported and tested by: Peter Holm Reviewed by: tegge MFC after: 2 weeks
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_bio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index b642040..44879ff 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -961,9 +961,11 @@ bdwrite(struct buf *bp)
*/
vp = bp->b_vp;
bo = bp->b_bufobj;
- if ((td->td_pflags & TDP_COWINPROGRESS) == 0)
+ if ((td->td_pflags & (TDP_COWINPROGRESS|TDP_INBDFLUSH)) == 0) {
+ td->td_pflags |= TDP_INBDFLUSH;
BO_BDFLUSH(bo, bp);
- else
+ td->td_pflags &= ~TDP_INBDFLUSH;
+ } else
recursiveflushes++;
bdirty(bp);
OpenPOWER on IntegriCloud