From 41d4783d494514df11aaeea38deba16ea3848606 Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Sun, 3 Apr 2005 10:38:18 +0000 Subject: - In ffs_sync we need to pass LK_SLEEPFAIL in when we lock the vnode because it may change identities while we're sleeping on the lock. Otherwise we may bail out of ffs_sync() early due to an error from deadfs. - Collapse a VOP_UNLOCK, vrele into a single vput(). --- sys/ufs/ffs/ffs_vfsops.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sys/ufs') diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 529a59e85452..dee50b08e362 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1083,7 +1083,7 @@ ffs_sync(mp, waitfor, td) wait = 1; lockreq = LK_EXCLUSIVE; } - lockreq |= LK_INTERLOCK; + lockreq |= LK_INTERLOCK | LK_SLEEPFAIL; MNT_ILOCK(mp); loop: MNT_VNODE_FOREACH(vp, mp, nvp) { @@ -1108,14 +1108,13 @@ loop: MNT_IUNLOCK(mp); if ((error = vget(vp, lockreq, td)) != 0) { MNT_ILOCK(mp); - if (error == ENOENT) + if (error == ENOENT || error == ENOLCK) goto loop; continue; } if ((error = ffs_syncvnode(vp, waitfor)) != 0) allerror = error; - VOP_UNLOCK(vp, 0, td); - vrele(vp); + vput(vp); MNT_ILOCK(mp); } MNT_IUNLOCK(mp); -- cgit v1.2.3