Commit 06f78b95 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] kNFSd: v4 exclusive open fix.

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.
parent 1bba2ff8
...@@ -95,6 +95,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o ...@@ -95,6 +95,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
accmode = MAY_READ; accmode = MAY_READ;
if (open->op_share_deny & NFS4_SHARE_ACCESS_WRITE) if (open->op_share_deny & NFS4_SHARE_ACCESS_WRITE)
accmode |= (MAY_WRITE | MAY_TRUNC); accmode |= (MAY_WRITE | MAY_TRUNC);
accmode |= MAY_OWNER_OVERRIDE;
status = fh_verify(rqstp, current_fh, S_IFREG, accmode); status = fh_verify(rqstp, current_fh, S_IFREG, accmode);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment