Ver Fonte

NFS Exclusive open not supported bug

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>
Andy Ryan há 18 anos atrás
pai
commit
46b9f8e148
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      fs/nfs/nfs3proc.c

+ 1 - 1
fs/nfs/nfs3proc.c

@@ -369,7 +369,7 @@ again:
 
 	/* 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;