summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_node.c
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2006-01-17 17:29:03 +0000
committeralfred <alfred@FreeBSD.org>2006-01-17 17:29:03 +0000
commita0282ebc04163163dc358c05c9071f8b0f17a9eb (patch)
tree8c53b5780d1f21ba97c11f102413f8370e4d4ca0 /sys/nfsclient/nfs_node.c
parent7f6555d455f978875b3f40b757762978fed9e05c (diff)
downloadFreeBSD-src-a0282ebc04163163dc358c05c9071f8b0f17a9eb.zip
FreeBSD-src-a0282ebc04163163dc358c05c9071f8b0f17a9eb.tar.gz
I ran into an nfs client panic a couple of times in a row over the
last few days. I tracked it down to the fact that nfs_reclaim() is setting vp->v_data to NULL _before_ calling vnode_destroy_object(). After silence from the mailing list I checked further and discovered that ufs_reclaim() is unique among FreeBSD filesystems for calling vnode_destroy_object() early, long before tossing v_data or much of anything else, for that matter. The rest, including NFS, appear to be identical, as if they were just clones of one original routine. The enclosed patch fixes all file systems in essentially the same way, by moving the call to vnode_destroy_object() to early in the routine (before the call to vfs_hash_remove(), if any). I have only tested NFS, but I've now run for over eighteen hours with the patch where I wouldn't get past four or five without it. Submitted by: Frank Mayhar Requested by: Mohan Srinivasan MFC After: 1 week
Diffstat (limited to 'sys/nfsclient/nfs_node.c')
-rw-r--r--sys/nfsclient/nfs_node.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c
index 47f5f4e..ada16f4 100644
--- a/sys/nfsclient/nfs_node.c
+++ b/sys/nfsclient/nfs_node.c
@@ -211,6 +211,11 @@ nfs_reclaim(struct vop_reclaim_args *ap)
if (prtactive && vrefcnt(vp) != 0)
vprint("nfs_reclaim: pushing active", vp);
+ /*
+ * Destroy the vm object and flush associated pages.
+ */
+ vnode_destroy_vobject(vp);
+
vfs_hash_remove(vp);
/*
@@ -232,6 +237,5 @@ nfs_reclaim(struct vop_reclaim_args *ap)
uma_zfree(nfsnode_zone, vp->v_data);
vp->v_data = NULL;
- vnode_destroy_vobject(vp);
return (0);
}
OpenPOWER on IntegriCloud