Skip to content

Commit

Permalink
ceph: try to dump the msgs when decoding fails
Browse files Browse the repository at this point in the history
[ Upstream commit 8b0da5c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
lxbsz authored and gregkh committed Aug 23, 2023
1 parent d92613a commit 3a89f3b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/ceph/mds_client.c
Expand Up @@ -645,6 +645,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;
}

Expand Down Expand Up @@ -3534,6 +3535,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,
Expand Down Expand Up @@ -5254,6 +5256,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;
Expand Down Expand Up @@ -5322,6 +5325,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;
}

Expand Down

0 comments on commit 3a89f3b

Please sign in to comment.