Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188653
b: refs/heads/master
c: 9ec7cab
h: refs/heads/master
i:
  188651: 5bb31df
v: v3
  • Loading branch information
Sage Weil committed Dec 22, 2009
1 parent 64d4bae commit 3e41436
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 93c20d98c29ccefa039c3843ccc37122caaf3d31
refs/heads/master: 9ec7cab14e6de732d4e7c355fe67c5810c32c758
1 change: 1 addition & 0 deletions trunk/fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 4 additions & 0 deletions trunk/fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions trunk/fs/ceph/mdsmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
20 changes: 20 additions & 0 deletions trunk/fs/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 0 deletions trunk/fs/ceph/messenger.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions trunk/fs/ceph/mon_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ static void handle_subscribe_ack(struct ceph_mon_client *monc,
return;
bad:
pr_err("got corrupt subscribe-ack msg\n");
ceph_msg_dump(msg);
}

/*
Expand Down Expand Up @@ -364,6 +365,7 @@ static void handle_statfs_reply(struct ceph_mon_client *monc,

bad:
pr_err("corrupt statfs reply, no tid\n");
ceph_msg_dump(msg);
}

/*
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg)
pr_err("corrupt osd_op_reply got %d %d expected %d\n",
(int)msg->front.iov_len, le32_to_cpu(msg->hdr.front_len),
(int)sizeof(*rhead));
ceph_msg_dump(msg);
}


Expand Down Expand Up @@ -964,6 +965,7 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)

bad:
pr_err("osdc handle_map corrupt msg\n");
ceph_msg_dump(msg);
up_write(&osdc->map_sem);
return;
}
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/ceph/osdmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,9 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
bad:
pr_err("corrupt inc osdmap epoch %d off %d (%p of %p-%p)\n",
epoch, (int)(*p - start), *p, start, end);
print_hex_dump(KERN_DEBUG, "osdmap: ",
DUMP_PREFIX_OFFSET, 16, 1,
start, end - start, true);
if (newcrush)
crush_destroy(newcrush);
return ERR_PTR(err);
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/ceph/snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc,

bad:
pr_err("corrupt snap message from mds%d\n", mds);
ceph_msg_dump(msg);
out:
if (locked_rwsem)
up_write(&mdsc->snap_rwsem);
Expand Down
9 changes: 2 additions & 7 deletions trunk/fs/ceph/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,8 @@ int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid)
{
if (client->have_fsid) {
if (ceph_fsid_compare(&client->fsid, fsid)) {
print_hex_dump(KERN_ERR, "this fsid: ",
DUMP_PREFIX_NONE, 16, 1,
(void *)fsid, 16, 0);
print_hex_dump(KERN_ERR, " old fsid: ",
DUMP_PREFIX_NONE, 16, 1,
(void *)&client->fsid, 16, 0);
pr_err("fsid mismatch\n");
pr_err("bad fsid, had " FSID_FORMAT " got " FSID_FORMAT,
PR_FSID(&client->fsid), PR_FSID(fsid));
return -1;
}
} else {
Expand Down

0 comments on commit 3e41436

Please sign in to comment.