Skip to content

Commit 9782005

Browse files
xiubliidryomov
authored andcommitted
ceph: check availability of mds cluster on mount after wait timeout
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>
1 parent 4d681c2 commit 9782005

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎fs/ceph/mds_client.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2583,8 +2583,7 @@ static void __do_request(struct ceph_mds_client *mdsc,
25832583
if (!(mdsc->fsc->mount_options->flags &
25842584
CEPH_MOUNT_OPT_MOUNTWAIT) &&
25852585
!ceph_mdsmap_is_cluster_available(mdsc->mdsmap)) {
2586-
err = -ENOENT;
2587-
pr_info("probably no mds server is up\n");
2586+
err = -EHOSTUNREACH;
25882587
goto finish;
25892588
}
25902589
}

‎fs/ceph/super.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,11 @@ static int ceph_get_tree(struct fs_context *fc)
10701070
return 0;
10711071

10721072
out_splat:
1073+
if (!ceph_mdsmap_is_cluster_available(fsc->mdsc->mdsmap)) {
1074+
pr_info("No mds server is up or the cluster is laggy\n");
1075+
err = -EHOSTUNREACH;
1076+
}
1077+
10731078
ceph_mdsc_close_sessions(fsc->mdsc);
10741079
deactivate_locked_super(sb);
10751080
goto out_final;

0 commit comments

Comments
 (0)