浏览代码

ceph: fix mds cluster availability check

We should apply the check after getting the initial mdsmap.

Fixes: e9e427f0a14f ("ceph: check availability of mds cluster on mount")
Link: http://tracker.ceph.com/issues/18161
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Yan, Zheng 8 年之前
父节点
当前提交
cc8e834293
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      fs/ceph/mds_client.c

+ 5 - 0
fs/ceph/mds_client.c

@@ -2106,6 +2106,11 @@ static int __do_request(struct ceph_mds_client *mdsc,
 			dout("do_request mdsmap err %d\n", err);
 			dout("do_request mdsmap err %d\n", err);
 			goto finish;
 			goto finish;
 		}
 		}
+		if (mdsc->mdsmap->m_epoch == 0) {
+			dout("do_request no mdsmap, waiting for map\n");
+			list_add(&req->r_wait, &mdsc->waiting_for_map);
+			goto finish;
+		}
 		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)) {