]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] kNFSd: NFSv4: allow type==0 in nfsd_unlink()
authorKendrick M. Smith <kmsmith@umich.edu>
Fri, 23 Aug 2002 04:38:02 +0000 (21:38 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 23 Aug 2002 04:38:02 +0000 (21:38 -0700)
If nfsd_unlink() is called with @type equal to 0, then let it do the
right thing regardless of the type of the file being unlinked.  This
is needed for the NFSv4 REMOVE operation, which works for any type of
file, even directories.

fs/nfsd/vfs.c

index 74e2732784637144a1d95dbcd4f172225a86541d..3a01584341d17cb613d47f7811634408f91e0fd7 100644 (file)
@@ -1329,6 +1329,9 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
                goto out;
        }
 
+       if (!type)
+               type = rdentry->d_inode->i_mode & S_IFMT;
+
        if (type != S_IFDIR) { /* It's UNLINK */
 #ifdef MSNFS
                if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&