- If we fail to do a non-blocking acquire of a buf lock while doing a
waiting sync pass we need to do a blocking acquire and restart. Another thread, typically the buf daemon, may have this buf locked and if we don't wait we can fail to sync the file. This lead to a great variety of softdep panics because we rely on all dependencies being flushed before proceeding in several cases. Reported by: pho Discussed with: mckusick Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks
This commit is contained in:
parent
f1c05bd42b
commit
9ee698e16a
@ -259,9 +259,17 @@ loop:
|
||||
continue;
|
||||
if (bp->b_lblkno > lbn)
|
||||
panic("ffs_syncvnode: syncing truncated data.");
|
||||
if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL))
|
||||
if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0) {
|
||||
BO_UNLOCK(bo);
|
||||
} else if (wait != 0) {
|
||||
if (BUF_LOCK(bp,
|
||||
LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK,
|
||||
BO_LOCKPTR(bo)) != 0) {
|
||||
bp->b_vflags &= ~BV_SCANNED;
|
||||
goto next;
|
||||
}
|
||||
} else
|
||||
continue;
|
||||
BO_UNLOCK(bo);
|
||||
if ((bp->b_flags & B_DELWRI) == 0)
|
||||
panic("ffs_fsync: not dirty");
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user