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
This commit is contained in:
Konstantin Belousov 2007-04-24 10:59:21 +00:00
parent b238c415a1
commit 8e68f804a7
2 changed files with 5 additions and 2 deletions

View File

@ -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);

View File

@ -366,6 +366,7 @@ struct thread {
#define TDP_SOFTDEP 0x00020000 /* Stuck processing softdep worklist */
#define TDP_NORUNNINGBUF 0x00040000 /* Ignore runningbufspace check */
#define TDP_WAKEUP 0x00080000 /* Don't sleep in umtx cond_wait */
#define TDP_INBDFLUSH 0x00100000 /* Already in BO_BDFLUSH, do not recurse */
/*
* Reasons that the current thread can not be run yet.