提交 46b9f8e1 编写于 作者: A Andy Ryan 提交者: Trond Myklebust

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: NAndy Ryan <genanr@allantgroup.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 8aca67f0
...@@ -369,7 +369,7 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, ...@@ -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, /* If the server doesn't support the exclusive creation semantics,
* try again with simple 'guarded' mode. */ * try again with simple 'guarded' mode. */
if (status == NFSERR_NOTSUPP) { if (status == -ENOTSUPP) {
switch (arg.createmode) { switch (arg.createmode) {
case NFS3_CREATE_EXCLUSIVE: case NFS3_CREATE_EXCLUSIVE:
arg.createmode = NFS3_CREATE_GUARDED; arg.createmode = NFS3_CREATE_GUARDED;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册