summaryrefslogtreecommitdiffstats
path: root/sys/gnu
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-10-05 06:43:03 +0000
committerjeff <jeff@FreeBSD.org>2003-10-05 06:43:03 +0000
commit29b3b781c2d4719782f46f1de18aadd6aeac1b87 (patch)
tree7dbe283484bf6ca737b531492fd34aaebf310dd3 /sys/gnu
parent2afc542330b163fbeee6747befdc667df1d6e5ca (diff)
downloadFreeBSD-src-29b3b781c2d4719782f46f1de18aadd6aeac1b87.zip
FreeBSD-src-29b3b781c2d4719782f46f1de18aadd6aeac1b87.tar.gz
- File systems that wish to inspect the vnode contents or their private
v_data field before calling vget/vn_lock must check VI_XLOCK manually to be sure that v_data is still valid. Implement this check in two places here.
Diffstat (limited to 'sys/gnu')
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c8
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index b8b15be..c9544c1 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -577,6 +577,10 @@ loop:
}
nvp = TAILQ_NEXT(vp, v_nmntvnodes);
VI_LOCK(vp);
+ if (vp->v_iflag & VI_XLOCK) {
+ VI_UNLOCK(vp);
+ continue;
+ }
mtx_unlock(&mntvnode_mtx);
/*
* Step 4: invalidate all inactive vnodes.
@@ -906,6 +910,10 @@ loop:
goto loop;
nvp = TAILQ_NEXT(vp, v_nmntvnodes);
VI_LOCK(vp);
+ if (vp->v_iflag & VI_XLOCK) {
+ VI_UNLOCK(vp);
+ continue;
+ }
mtx_unlock(&mntvnode_mtx);
ip = VTOI(vp);
if (vp->v_type == VNON ||
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index b8b15be..c9544c1 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -577,6 +577,10 @@ loop:
}
nvp = TAILQ_NEXT(vp, v_nmntvnodes);
VI_LOCK(vp);
+ if (vp->v_iflag & VI_XLOCK) {
+ VI_UNLOCK(vp);
+ continue;
+ }
mtx_unlock(&mntvnode_mtx);
/*
* Step 4: invalidate all inactive vnodes.
@@ -906,6 +910,10 @@ loop:
goto loop;
nvp = TAILQ_NEXT(vp, v_nmntvnodes);
VI_LOCK(vp);
+ if (vp->v_iflag & VI_XLOCK) {
+ VI_UNLOCK(vp);
+ continue;
+ }
mtx_unlock(&mntvnode_mtx);
ip = VTOI(vp);
if (vp->v_type == VNON ||
OpenPOWER on IntegriCloud