summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs/ffs_vfsops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 04c4dba..c6c6510 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -445,7 +445,7 @@ ffs_cmount(struct mntarg *ma, void *data, int flags, struct thread *td)
static int
ffs_reload(struct mount *mp, struct thread *td)
{
- struct vnode *vp, *nvp, *devvp;
+ struct vnode *vp, *mvp, *devvp;
struct inode *ip;
void *space;
struct buf *bp;
@@ -536,7 +536,7 @@ ffs_reload(struct mount *mp, struct thread *td)
loop:
MNT_ILOCK(mp);
- MNT_VNODE_FOREACH(vp, mp, nvp) {
+ MNT_VNODE_FOREACH(vp, mp, mvp) {
VI_LOCK(vp);
if (vp->v_iflag & VI_DOOMED) {
VI_UNLOCK(vp);
@@ -547,6 +547,7 @@ loop:
* Step 4: invalidate all cached file data.
*/
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) {
+ MNT_VNODE_FOREACH_ABORT(mp, mvp);
goto loop;
}
if (vinvalbuf(vp, 0, td, 0, 0))
@@ -561,6 +562,7 @@ loop:
if (error) {
VOP_UNLOCK(vp, 0, td);
vrele(vp);
+ MNT_VNODE_FOREACH_ABORT(mp, mvp);
return (error);
}
ffs_load_inode(bp, ip, fs, ip->i_number);
@@ -1106,7 +1108,7 @@ ffs_sync(mp, waitfor, td)
int waitfor;
struct thread *td;
{
- struct vnode *nvp, *vp, *devvp;
+ struct vnode *mvp, *vp, *devvp;
struct inode *ip;
struct ufsmount *ump = VFSTOUFS(mp);
struct fs *fs;
@@ -1130,7 +1132,7 @@ ffs_sync(mp, waitfor, td)
lockreq |= LK_INTERLOCK | LK_SLEEPFAIL;
MNT_ILOCK(mp);
loop:
- MNT_VNODE_FOREACH(vp, mp, nvp) {
+ MNT_VNODE_FOREACH(vp, mp, mvp) {
/*
* Depend on the mntvnode_slock to keep things stable enough
* for a quick test. Since there might be hundreds of
@@ -1152,8 +1154,10 @@ loop:
MNT_IUNLOCK(mp);
if ((error = vget(vp, lockreq, td)) != 0) {
MNT_ILOCK(mp);
- if (error == ENOENT || error == ENOLCK)
+ if (error == ENOENT || error == ENOLCK) {
+ MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp);
goto loop;
+ }
continue;
}
if ((error = ffs_syncvnode(vp, waitfor)) != 0)
OpenPOWER on IntegriCloud