Skip to content

Commit

Permalink
NFS Exclusive open not supported bug
Browse files Browse the repository at this point in the history
When trying to open a file with the O_EXCL flag over NFS on a server that does
not support exclusive mode, the file does not open.  The reason,
rpc_call_sync returns a errno number, and not the nfs error number.  I fixed
it by changing the status check in nfs3proc.c.  Either this is how it should
be fixed, or rpc_call_sync should be fixed to return the NFS error.

Signed-off-by: Andy Ryan <genanr@allantgroup.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Andy Ryan authored and Trond Myklebust committed Dec 6, 2006
1 parent 8aca67f commit 46b9f8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/nfs3proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,

/* If the server doesn't support the exclusive creation semantics,
* try again with simple 'guarded' mode. */
if (status == NFSERR_NOTSUPP) {
if (status == -ENOTSUPP) {
switch (arg.createmode) {
case NFS3_CREATE_EXCLUSIVE:
arg.createmode = NFS3_CREATE_GUARDED;
Expand Down

0 comments on commit 46b9f8e

Please sign in to comment.