summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2006-04-04 06:46:10 +0000
committerjeff <jeff@FreeBSD.org>2006-04-04 06:46:10 +0000
commit275c043cbe67c0778a690932c6ed437ed4af83a3 (patch)
tree16372ca8388de595c6abbcab1359cee7a49b5372 /sys/kern
parent6862688995c34f4904434a46717e1dd39c1d9e85 (diff)
downloadFreeBSD-src-275c043cbe67c0778a690932c6ed437ed4af83a3.zip
FreeBSD-src-275c043cbe67c0778a690932c6ed437ed4af83a3.tar.gz
- VFS_LOCK_GIANT when recycling a vnode via getnewvnode. We may be
recycling for an unrelated filesystem. I really don't like potentially acquiring giant in the context of a giantless filesystem but there are reasonable objections to removing the recycling from this path. Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_subr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index ebe5f34..ca85d6f 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -640,6 +640,7 @@ static void
vnlru_free(int count)
{
struct vnode *vp;
+ int vfslocked;
mtx_assert(&vnode_free_list_mtx, MA_OWNED);
for (; count > 0; count--) {
@@ -667,7 +668,9 @@ vnlru_free(int count)
vholdl(vp);
mtx_unlock(&vnode_free_list_mtx);
VI_UNLOCK(vp);
+ vfslocked = VFS_LOCK_GIANT(vp->v_mount);
vtryrecycle(vp);
+ VFS_UNLOCK_GIANT(vfslocked);
/*
* If the recycled succeeded this vdrop will actually free
* the vnode. If not it will simply place it back on
OpenPOWER on IntegriCloud