summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-04-27 10:03:21 +0000
committerjeff <jeff@FreeBSD.org>2005-04-27 10:03:21 +0000
commit0e56b01ed6ecd47900b8028cae6e77660470d18c (patch)
tree87725367f074237c127beb44f9908995a7d6d82d
parentc600dcc049acd13c67f6ae0ac00397e3f498aa0c (diff)
downloadFreeBSD-src-0e56b01ed6ecd47900b8028cae6e77660470d18c.zip
FreeBSD-src-0e56b01ed6ecd47900b8028cae6e77660470d18c.tar.gz
- Don't vgonel() via vgone() or vrecycle() if the vnode is already doomed.
This fixes forced unmounts via nullfs. Reported by: kkenn Sponsored by: Isilon Systems, Inc.
-rw-r--r--sys/kern/vfs_subr.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 8b4d814..3c900ad 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -2199,7 +2199,7 @@ vrecycle(struct vnode *vp, struct thread *td)
ASSERT_VOP_LOCKED(vp, "vrecycle");
VI_LOCK(vp);
- if (vp->v_usecount == 0) {
+ if (vp->v_usecount == 0 && (vp->v_iflag & VI_DOOMED) == 0) {
vgonel(vp, td);
return (1);
}
@@ -2217,7 +2217,14 @@ vgone(struct vnode *vp)
struct thread *td = curthread; /* XXX */
ASSERT_VOP_LOCKED(vp, "vgone");
+ /*
+ * Don't vgonel if we're already doomed.
+ */
VI_LOCK(vp);
+ if (vp->v_iflag & VI_DOOMED) {
+ VI_UNLOCK(vp);
+ return;
+ }
vgonel(vp, td);
}
OpenPOWER on IntegriCloud