summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2019-12-10 20:29:40 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-24 08:34:52 +0100
commit68983ba2c746eeaff7192948ed63377d359df5fb (patch)
treedf7b182ba148d0f84f3ae1c4a26694c4764a7e37
parentca2b45936522f128c6b7b26399fb316be2f35af1 (diff)
downloadlinux-stable-68983ba2c746eeaff7192948ed63377d359df5fb.tar.gz
linux-stable-68983ba2c746eeaff7192948ed63377d359df5fb.tar.bz2
linux-stable-68983ba2c746eeaff7192948ed63377d359df5fb.zip
ceph: check availability of mds cluster on mount after wait timeout
[ Upstream commit 97820058fb2831a4b203981fa2566ceaaa396103 ] 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/4386 Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/ceph/mds_client.c3
-rw-r--r--fs/ceph/super.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 09db6d08614d..a2e903203bf9 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2343,8 +2343,7 @@ static void __do_request(struct ceph_mds_client *mdsc,
if (!(mdsc->fsc->mount_options->flags &
CEPH_MOUNT_OPT_MOUNTWAIT) &&
!ceph_mdsmap_is_cluster_available(mdsc->mdsmap)) {
- err = -ENOENT;
- pr_info("probably no mds server is up\n");
+ err = -EHOSTUNREACH;
goto finish;
}
}
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 2bd0b1ed9708..c4314f449240 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -1106,6 +1106,11 @@ static struct dentry *ceph_mount(struct file_system_type *fs_type,
return res;
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);
deactivate_locked_super(sb);
goto out_final;