summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_vnops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/nfs/nfs_vnops.c')
-rw-r--r--sys/nfs/nfs_vnops.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index d71bdbfe455..9cc06201a50 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.70 2007/01/16 17:52:18 thib Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.71 2007/01/21 15:52:39 pedro Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -1457,7 +1457,16 @@ nfs_removerpc(dvp, name, namelen, cred, proc)
caddr_t bpos, dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
- int v3 = NFS_ISV3(dvp);
+ int v3;
+
+ /*
+ * It is possible for our directory vnode to have been flushed out
+ * before us. If that's the case, we can't remove the file.
+ */
+ if (dvp->v_type == VBAD)
+ return (EIO);
+
+ v3 = NFS_ISV3(dvp);
nfsstats.rpccnt[NFSPROC_REMOVE]++;
nfsm_reqhead(dvp, NFSPROC_REMOVE,