ceph: try to dump the msgs when decoding fails
authorXiubo Li <xiubli@redhat.com>
Thu, 18 May 2023 01:40:14 +0000 (09:40 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 30 Jun 2023 10:08:54 +0000 (12:08 +0200)
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.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/mds_client.c

index 4c0f22a..66048a8 100644 (file)
@@ -645,6 +645,7 @@ bad:
        err = -EIO;
 out_bad:
        pr_err("mds parse_reply err %d\n", err);
+       ceph_msg_dump(msg);
        return err;
 }
 
@@ -3538,6 +3539,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,
@@ -5258,6 +5260,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;
@@ -5326,6 +5329,7 @@ bad_unlock:
 bad:
        pr_err("error decoding mdsmap %d. Shutting down mount.\n", err);
        ceph_umount_begin(mdsc->fsc->sb);
+       ceph_msg_dump(msg);
        return;
 }