Commit 68983ba2 authored by Xiubo Li's avatar Xiubo Li Committed by Greg Kroah-Hartman

ceph: check availability of mds cluster on mount after wait timeout

[ Upstream commit 97820058 ]

If all the MDS daemons are down for some reason, then the first mount
attempt will fail with EIO after the mount request times out.  A mount
attempt will also fail with EIO if all of the MDS's are laggy.

This patch changes the code to return -EHOSTUNREACH in these situations
and adds a pr_info error message to help the admin determine the cause.

URL: https://tracker.ceph.com/issues/4386Signed-off-by: default avatarXiubo Li <xiubli@redhat.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ca2b4593
...@@ -2343,8 +2343,7 @@ static void __do_request(struct ceph_mds_client *mdsc, ...@@ -2343,8 +2343,7 @@ static void __do_request(struct ceph_mds_client *mdsc,
if (!(mdsc->fsc->mount_options->flags & if (!(mdsc->fsc->mount_options->flags &
CEPH_MOUNT_OPT_MOUNTWAIT) && CEPH_MOUNT_OPT_MOUNTWAIT) &&
!ceph_mdsmap_is_cluster_available(mdsc->mdsmap)) { !ceph_mdsmap_is_cluster_available(mdsc->mdsmap)) {
err = -ENOENT; err = -EHOSTUNREACH;
pr_info("probably no mds server is up\n");
goto finish; goto finish;
} }
} }
......
...@@ -1106,6 +1106,11 @@ static struct dentry *ceph_mount(struct file_system_type *fs_type, ...@@ -1106,6 +1106,11 @@ static struct dentry *ceph_mount(struct file_system_type *fs_type,
return res; return res;
out_splat: out_splat:
if (!ceph_mdsmap_is_cluster_available(fsc->mdsc->mdsmap)) {
pr_info("No mds server is up or the cluster is laggy\n");
err = -EHOSTUNREACH;
}
ceph_mdsc_close_sessions(fsc->mdsc); ceph_mdsc_close_sessions(fsc->mdsc);
deactivate_locked_super(sb); deactivate_locked_super(sb);
goto out_final; goto out_final;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment