]> git.hungrycats.org Git - linux/commitdiff
[PATCH] kNFSd: v4 exclusive open fix.
authorAndrew Morton <akpm@osdl.org>
Thu, 26 Feb 2004 14:46:20 +0000 (06:46 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 26 Feb 2004 14:46:20 +0000 (06:46 -0800)
From: NeilBrown <neilb@cse.unsw.edu.au>

Exclusive creates were failing with permission errors, because they don't set
the mode on the newly created file, and the permission check in fh_verify
(called at the end of do_open_lookup) was failing.  So pass in the
MAY_OWNER_OVERRIDE flag to allow the owner of the file to override the
permission check.

fs/nfsd/nfs4proc.c

index cc8f6728e43510d1d9078da1f705d177e0d4be28..c9398a6531e43d4ad4ee3def3d9a60bdebfeb3be 100644 (file)
@@ -95,6 +95,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
                        accmode = MAY_READ;
                if (open->op_share_deny & NFS4_SHARE_ACCESS_WRITE)
                        accmode |= (MAY_WRITE | MAY_TRUNC);
+               accmode |= MAY_OWNER_OVERRIDE;
                status = fh_verify(rqstp, current_fh, S_IFREG, accmode);
        }