From a0282ebc04163163dc358c05c9071f8b0f17a9eb Mon Sep 17 00:00:00 2001 From: alfred Date: Tue, 17 Jan 2006 17:29:03 +0000 Subject: 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 --- sys/fs/msdosfs/msdosfs_denode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/fs/msdosfs/msdosfs_denode.c') diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index effc20b..e2dbc9b 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -549,6 +549,10 @@ msdosfs_reclaim(ap) if (prtactive && vrefcnt(vp) != 0) vprint("msdosfs_reclaim(): pushing active", vp); /* + * Destroy the vm object and flush associated pages. + */ + vnode_destroy_vobject(vp); + /* * Remove the denode from its hash chain. */ vfs_hash_remove(vp); @@ -560,7 +564,6 @@ msdosfs_reclaim(ap) #endif FREE(dep, M_MSDOSFSNODE); vp->v_data = NULL; - vnode_destroy_vobject(vp); return (0); } -- cgit v1.1