diff options
author | iedowse <iedowse@FreeBSD.org> | 2003-06-12 15:41:20 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2003-06-12 15:41:20 +0000 |
commit | 2c04f19896deabdbfe1e011087fc704fea36c01a (patch) | |
tree | 03a4c3a20614525bbe21f7a1e541e372d5ead802 /sys/nfsclient | |
parent | f5b3c140115e33e0d1ac330c63adc18be7582200 (diff) | |
download | FreeBSD-src-2c04f19896deabdbfe1e011087fc704fea36c01a.zip FreeBSD-src-2c04f19896deabdbfe1e011087fc704fea36c01a.tar.gz |
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
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 9e23230..3a52302 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)); } |