Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ec7cab1 authored by Sage Weil's avatar Sage Weil
Browse files

ceph: hex dump corrupt server data to KERN_DEBUG



Also, print fsid using standard format, NOT hex dump.

Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 93c20d98
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2681,6 +2681,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,

bad:
	pr_err("ceph_handle_caps: corrupt message\n");
	ceph_msg_dump(msg);
	return;
}

+4 −0
Original line number Diff line number Diff line
@@ -1650,6 +1650,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
		return;
	if (msg->front.iov_len < sizeof(*head)) {
		pr_err("mdsc_handle_reply got corrupt (short) reply\n");
		ceph_msg_dump(msg);
		return;
	}

@@ -1740,6 +1741,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
	mutex_lock(&session->s_mutex);
	if (err < 0) {
		pr_err("mdsc_handle_reply got corrupt reply mds%d\n", mds);
		ceph_msg_dump(msg);
		goto out_err;
	}

@@ -1929,6 +1931,7 @@ static void handle_session(struct ceph_mds_session *session,
bad:
	pr_err("mdsc_handle_session corrupt message mds%d len %d\n", mds,
	       (int)msg->front.iov_len);
	ceph_msg_dump(msg);
	return;
}

@@ -2394,6 +2397,7 @@ static void handle_lease(struct ceph_mds_client *mdsc, struct ceph_msg *msg)

bad:
	pr_err("corrupt lease message\n");
	ceph_msg_dump(msg);
}

void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session,
+4 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ int ceph_mdsmap_get_random_mds(struct ceph_mdsmap *m)
struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
{
	struct ceph_mdsmap *m;
	const void *start = *p;
	int i, j, n;
	int err = -EINVAL;
	u16 version;
@@ -154,6 +155,9 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
	err = -ENOMEM;
bad:
	pr_err("corrupt mdsmap\n");
	print_hex_dump(KERN_DEBUG, "mdsmap: ",
		       DUMP_PREFIX_OFFSET, 16, 1,
		       start, end - start, true);
	ceph_mdsmap_destroy(m);
	return ERR_PTR(-EINVAL);
}
+20 −0
Original line number Diff line number Diff line
@@ -2115,3 +2115,23 @@ void ceph_msg_last_put(struct kref *kref)
	else
		ceph_msg_kfree(m);
}

void ceph_msg_dump(struct ceph_msg *msg)
{
	pr_debug("msg_dump %p (front_max %d nr_pages %d)\n", msg,
		 msg->front_max, msg->nr_pages);
	print_hex_dump(KERN_DEBUG, "header: ",
		       DUMP_PREFIX_OFFSET, 16, 1,
		       &msg->hdr, sizeof(msg->hdr), true);
	print_hex_dump(KERN_DEBUG, " front: ",
		       DUMP_PREFIX_OFFSET, 16, 1,
		       msg->front.iov_base, msg->front.iov_len, true);
	if (msg->middle)
		print_hex_dump(KERN_DEBUG, "middle: ",
			       DUMP_PREFIX_OFFSET, 16, 1,
			       msg->middle->vec.iov_base,
			       msg->middle->vec.iov_len, true);
	print_hex_dump(KERN_DEBUG, "footer: ",
		       DUMP_PREFIX_OFFSET, 16, 1,
		       &msg->footer, sizeof(msg->footer), true);
}
+2 −0
Original line number Diff line number Diff line
@@ -254,4 +254,6 @@ static inline void ceph_msg_put(struct ceph_msg *msg)
	kref_put(&msg->kref, ceph_msg_last_put);
}

extern void ceph_msg_dump(struct ceph_msg *msg);

#endif
Loading