summaryrefslogtreecommitdiff
path: root/fs/ceph/debugfs.c
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2019-12-04 06:57:39 -0500
committerIlya Dryomov <idryomov@gmail.com>2020-01-27 16:53:40 +0100
commitb38c9eb4757d5bac1eb8634a9516ef918fca2525 (patch)
treee6706d4a886a2be10dc54b7c88c63abb3ea29e6e /fs/ceph/debugfs.c
parent0eb308531f0776fc87f7a7eb4a8efe943d98ab8c (diff)
ceph: add possible_max_rank and make the code more readable
The m_num_mds here is actually the number for MDSs which are in up:active status, and it will be duplicated to m_num_active_mds, so remove it. Add possible_max_rank to the mdsmap struct and this will be the correctly possible largest rank boundary. Remove the special case for one mds in __mdsmap_get_random_mds(), because the validate mds rank may not always be 0. Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/debugfs.c')
-rw-r--r--fs/ceph/debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index c281f32b54f7..fb7cabd98e7b 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -33,7 +33,7 @@ static int mdsmap_show(struct seq_file *s, void *p)
seq_printf(s, "max_mds %d\n", mdsmap->m_max_mds);
seq_printf(s, "session_timeout %d\n", mdsmap->m_session_timeout);
seq_printf(s, "session_autoclose %d\n", mdsmap->m_session_autoclose);
- for (i = 0; i < mdsmap->m_num_mds; i++) {
+ for (i = 0; i < mdsmap->possible_max_rank; i++) {
struct ceph_entity_addr *addr = &mdsmap->m_info[i].addr;
int state = mdsmap->m_info[i].state;
seq_printf(s, "\tmds%d\t%s\t(%s)\n", i,