From 46b9f8e1484352f09f229107ba2a758fe386d7f7 Mon Sep 17 00:00:00 2001 From: Andy Ryan Date: Tue, 7 Nov 2006 14:36:26 -0600 Subject: [PATCH] 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 Signed-off-by: Trond Myklebust --- fs/nfs/nfs3proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index e5f128ffc32d..9d7ff4f83faf 100644 --- a/fs/nfs/nfs3proc.c +++ b/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; -- 2.20.1