summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-06-28 03:52:04 +0000
committerjhb <jhb@FreeBSD.org>2001-06-28 03:52:04 +0000
commit0bd9d86c0af02f2998bfd0eaf5b4dd49683dbc90 (patch)
tree87f7ed16ce226c263a3dcbabb821e60d929ef73d /sys
parent54c05ef2f2ac9b7b4b641808d5ca5a0dbeef7a6a (diff)
downloadFreeBSD-src-0bd9d86c0af02f2998bfd0eaf5b4dd49683dbc90.zip
FreeBSD-src-0bd9d86c0af02f2998bfd0eaf5b4dd49683dbc90.tar.gz
Fix a mntvnode and vnode interlock reversal.
Diffstat (limited to 'sys')
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c5
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c7
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c7
3 files changed, 11 insertions, 8 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index 7cc8647..1962daf 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -866,18 +866,19 @@ loop:
*/
if (vp->v_mount != mp)
goto loop;
+ nvp = LIST_NEXT(vp, v_mntvnodes);
+ mtx_unlock(&mntvnode_mtx);
mtx_lock(&vp->v_interlock);
- nvp = LIST_NEXT(vp, v_mntvnodes);
dep = VTODE(vp);
if (vp->v_type == VNON ||
((dep->de_flag &
(DE_ACCESS | DE_CREATE | DE_UPDATE | DE_MODIFIED)) == 0 &&
(TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY))) {
mtx_unlock(&vp->v_interlock);
+ mtx_lock(&mntvnode_mtx);
continue;
}
- mtx_unlock(&mntvnode_mtx);
error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, p);
if (error) {
mtx_lock(&mntvnode_mtx);
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index 05bb202..9834131 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -582,8 +582,8 @@ loop:
/*
* Step 5: invalidate all cached file data.
*/
- mtx_lock(&vp->v_interlock);
mtx_unlock(&mntvnode_mtx);
+ mtx_lock(&vp->v_interlock);
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) {
goto loop;
}
@@ -933,17 +933,18 @@ loop:
*/
if (vp->v_mount != mp)
goto loop;
- mtx_lock(&vp->v_interlock);
nvp = LIST_NEXT(vp, v_mntvnodes);
+ mtx_unlock(&mntvnode_mtx);
+ mtx_lock(&vp->v_interlock);
ip = VTOI(vp);
if (vp->v_type == VNON ||
((ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 &&
(TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY))) {
mtx_unlock(&vp->v_interlock);
+ mtx_lock(&mntvnode_mtx);
continue;
}
- mtx_unlock(&mntvnode_mtx);
error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, p);
if (error) {
mtx_lock(&mntvnode_mtx);
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index 05bb202..9834131 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -582,8 +582,8 @@ loop:
/*
* Step 5: invalidate all cached file data.
*/
- mtx_lock(&vp->v_interlock);
mtx_unlock(&mntvnode_mtx);
+ mtx_lock(&vp->v_interlock);
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) {
goto loop;
}
@@ -933,17 +933,18 @@ loop:
*/
if (vp->v_mount != mp)
goto loop;
- mtx_lock(&vp->v_interlock);
nvp = LIST_NEXT(vp, v_mntvnodes);
+ mtx_unlock(&mntvnode_mtx);
+ mtx_lock(&vp->v_interlock);
ip = VTOI(vp);
if (vp->v_type == VNON ||
((ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 &&
(TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY))) {
mtx_unlock(&vp->v_interlock);
+ mtx_lock(&mntvnode_mtx);
continue;
}
- mtx_unlock(&mntvnode_mtx);
error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, p);
if (error) {
mtx_lock(&mntvnode_mtx);
OpenPOWER on IntegriCloud