Skip to contentSkip to conversation

ceph: try to dump the msgs when decoding fails

PATCH New [email protected] 1 participant 1 message May 18, 2023 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: try to dump the msgs when decoding fails

From: Xiubo Li <[email protected]>

When the msgs are corrupted we need to dump them and then it will be easier to dig what has happened and where the issue is.

---
 fs/ceph/mds_client.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/ceph/mds_client.c +4 -0
index d6467fe7e5fa..0dd44747f5b4 100644
@@ -783,6 +783,7 @@ static int parse_reply_info(struct ceph_mds_session *s, struct ceph_msg *msg,
 	err = -EIO;
 out_bad:
 	pr_err("mds parse_reply err %d\n", err);
+	ceph_msg_dump(msg);
 	return err;
 }
 
@@ -3892,6 +3893,7 @@ static void handle_forward(struct ceph_mds_client *mdsc,
 
 bad:
 	pr_err("mdsc_handle_forward decode error err=%d\n", err);
+	ceph_msg_dump(msg);
 }
 
 static int __decode_session_metadata(void **p, void *end,
@@ -5620,6 +5622,7 @@ void ceph_mdsc_handle_fsmap(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
 bad:
 	pr_err("error decoding fsmap %d. Shutting down mount.\n", err);
 	ceph_umount_begin(mdsc->fsc->sb);
+	ceph_msg_dump(msg);
 err_out:
 	mutex_lock(&mdsc->mutex);
 	mdsc->mdsmap_err = err;
@@ -5688,6 +5691,7 @@ void ceph_mdsc_handle_mdsmap(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
 bad:
 	pr_err("error decoding mdsmap %d. Shutting down mount.\n", err);
 	ceph_umount_begin(mdsc->fsc->sb);
+	ceph_msg_dump(msg);
 	return;
 }
 
Signature · 1 line
2.40.1