From df12c1663066dff90013c1f41d96d4aa32c95d44 Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Thu, 12 Jun 2003 15:41:20 +0000 Subject: [PATCH] When removing a sillyrename file, make sure that the directory vnode has not been cleaned in the meantime, since this can happen during a forced unmount. Also add a comment that nfs_removeit() should really be locking the directory vnode before calling nfs_removerpc(). Reported by: mbr Tested by: mbr MFC after: 1 week --- sys/nfsclient/nfs_vnops.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 9e23230bac7a..3a523028bd8e 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -1463,6 +1463,12 @@ int nfs_removeit(struct sillyrename *sp) { + /* + * Make sure that the directory vnode is still valid. + * XXX we should lock sp->s_dvp here. + */ + if (sp->s_dvp->v_type == VBAD) + return (0); return (nfs_removerpc(sp->s_dvp, sp->s_name, sp->s_namlen, sp->s_cred, NULL)); }