client: check mds down status bofore getting mds_gid_t from mdsmap
Get mds_gid_t from up of MDSMap, will cause to core dump if target
mds_rank_t does not exist up map:
from: src/mds/MDSMap.h
const auto& get_info(mds_rank_t m) const {
return mds_info.at(up.at(m));
}
reproduct:
1. ceph fs fail <fs_name>
2. curl -X GET "example.com:8080/api/cephfs/1/clients" ...
up.at(m) will cause to core dump.
Fixes: https://tracker.ceph.com/issues/61844
Signed-off-by: Yite Gu <yitegu0@gmail.com>
(cherry picked from commit
878463ef3a26f49b9ccad9696ad130fb5aee47e7)