Commit da08e1e1 authored by Xiubo Li's avatar Xiubo Li Committed by Ilya Dryomov

ceph: add more debug info when decoding mdsmap

Show the laggy state.
Signed-off-by: default avatarXiubo Li <xiubli@redhat.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent bd84fbcb
...@@ -158,6 +158,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) ...@@ -158,6 +158,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
void *pexport_targets = NULL; void *pexport_targets = NULL;
struct ceph_timespec laggy_since; struct ceph_timespec laggy_since;
struct ceph_mds_info *info; struct ceph_mds_info *info;
bool laggy;
ceph_decode_need(p, end, sizeof(u64) + 1, bad); ceph_decode_need(p, end, sizeof(u64) + 1, bad);
global_id = ceph_decode_64(p); global_id = ceph_decode_64(p);
...@@ -190,6 +191,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) ...@@ -190,6 +191,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
if (err) if (err)
goto corrupt; goto corrupt;
ceph_decode_copy(p, &laggy_since, sizeof(laggy_since)); ceph_decode_copy(p, &laggy_since, sizeof(laggy_since));
laggy = laggy_since.tv_sec != 0 || laggy_since.tv_nsec != 0;
*p += sizeof(u32); *p += sizeof(u32);
ceph_decode_32_safe(p, end, namelen, bad); ceph_decode_32_safe(p, end, namelen, bad);
*p += namelen; *p += namelen;
...@@ -207,10 +209,11 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) ...@@ -207,10 +209,11 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
*p = info_end; *p = info_end;
} }
dout("mdsmap_decode %d/%d %lld mds%d.%d %s %s\n", dout("mdsmap_decode %d/%d %lld mds%d.%d %s %s%s\n",
i+1, n, global_id, mds, inc, i+1, n, global_id, mds, inc,
ceph_pr_addr(&addr), ceph_pr_addr(&addr),
ceph_mds_state_name(state)); ceph_mds_state_name(state),
laggy ? "(laggy)" : "");
if (mds < 0 || state <= 0) if (mds < 0 || state <= 0)
continue; continue;
...@@ -230,8 +233,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) ...@@ -230,8 +233,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
info->global_id = global_id; info->global_id = global_id;
info->state = state; info->state = state;
info->addr = addr; info->addr = addr;
info->laggy = (laggy_since.tv_sec != 0 || info->laggy = laggy;
laggy_since.tv_nsec != 0);
info->num_export_targets = num_export_targets; info->num_export_targets = num_export_targets;
if (num_export_targets) { if (num_export_targets) {
info->export_targets = kcalloc(num_export_targets, info->export_targets = kcalloc(num_export_targets,
...@@ -355,6 +357,8 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) ...@@ -355,6 +357,8 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
m->m_damaged = false; m->m_damaged = false;
} }
bad_ext: bad_ext:
dout("mdsmap_decode m_enabled: %d, m_damaged: %d, m_num_laggy: %d\n",
!!m->m_enabled, !!m->m_damaged, m->m_num_laggy);
*p = end; *p = end;
dout("mdsmap_decode success epoch %u\n", m->m_epoch); dout("mdsmap_decode success epoch %u\n", m->m_epoch);
return m; return m;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment