提交 8491945f 编写于 作者: S Steve Dickson 提交者: Trond Myklebust

NFS: Client mounts hang when exported directory do not exist

This patch fixes a regression that was introduced by the string based mounts.

nfs_mount() statically returns -EACCES for every error returned
by the remote mounted. This is incorrect because -EACCES is
an non-fatal error to the mount.nfs command. This error causes
mount.nfs to retry the mount even in the case when the exported
directory does not exist.

This patch maps the errors returned by the remote mountd into
valid errno values, exactly how it was done pre-string based
mounts. By returning the correct errno enables mount.nfs
to do the right thing.
Signed-off-by: NSteve Dickson <steved@redhat.com>
[Trond.Myklebust@netapp.com: nfs_stat_to_errno() now correctly returns
 negative errors, so remove the sign change.]
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 96165e2b
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/sunrpc/clnt.h> #include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/sched.h> #include <linux/sunrpc/sched.h>
#include <linux/nfs_fs.h> #include <linux/nfs_fs.h>
#include "internal.h"
#ifdef RPC_DEBUG #ifdef RPC_DEBUG
# define NFSDBG_FACILITY NFSDBG_MOUNT # define NFSDBG_FACILITY NFSDBG_MOUNT
...@@ -98,7 +99,7 @@ int nfs_mount(struct sockaddr *addr, size_t len, char *hostname, char *path, ...@@ -98,7 +99,7 @@ int nfs_mount(struct sockaddr *addr, size_t len, char *hostname, char *path,
out_mnt_err: out_mnt_err:
dprintk("NFS: MNT server returned result %d\n", result.status); dprintk("NFS: MNT server returned result %d\n", result.status);
status = -EACCES; status = nfs_stat_to_errno(result.status);
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册