diff options
author | alfred <alfred@FreeBSD.org> | 2006-01-17 17:29:03 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2006-01-17 17:29:03 +0000 |
commit | a0282ebc04163163dc358c05c9071f8b0f17a9eb (patch) | |
tree | 8c53b5780d1f21ba97c11f102413f8370e4d4ca0 /sys/fs/smbfs/smbfs_node.c | |
parent | 7f6555d455f978875b3f40b757762978fed9e05c (diff) | |
download | FreeBSD-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/fs/smbfs/smbfs_node.c')
-rw-r--r-- | sys/fs/smbfs/smbfs_node.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/smbfs/smbfs_node.c b/sys/fs/smbfs/smbfs_node.c index d48bdb76..45ab034 100644 --- a/sys/fs/smbfs/smbfs_node.c +++ b/sys/fs/smbfs/smbfs_node.c @@ -319,6 +319,10 @@ smbfs_reclaim(ap) KASSERT((np->n_flag & NOPEN) == 0, ("file not closed before reclaim")); smbfs_hash_lock(smp, td); + /* + * Destroy the vm object and flush associated pages. + */ + vnode_destroy_vobject(vp); dvp = (np->n_parent && (np->n_flag & NREFPARENT)) ? np->n_parent : NULL; @@ -330,7 +334,6 @@ smbfs_reclaim(ap) smp->sm_root = NULL; } vp->v_data = NULL; - vnode_destroy_vobject(vp); smbfs_hash_unlock(smp, td); if (np->n_name) smbfs_name_free(np->n_name); |