aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2005-04-03 10:38:18 +0000
committerJeff Roberson <jeff@FreeBSD.org>2005-04-03 10:38:18 +0000
commit41d4783d494514df11aaeea38deba16ea3848606 (patch)
tree1b1f4b7e5a669effe6ea74da7c3d94c328d7e596 /sys/ufs
parent153910e0f58f6329b4a4229058b193d5bf5e9568 (diff)
downloadsrc-41d4783d494514df11aaeea38deba16ea3848606.tar.gz
src-41d4783d494514df11aaeea38deba16ea3848606.zip
- 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().
Notes
Notes: svn path=/head/; revision=144586
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c7
1 files changed, 3 insertions, 4 deletions
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);