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.
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);
}