aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/mon_client.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-10-14 20:36:07 -0400
committerSage Weil <sage@newdream.net>2009-10-15 21:14:43 -0400
commit8f3bc053c610826a657714649ea596f07875db2e (patch)
tree97823cb2a202439bb9f9839e2d326ac95d728dd0 /fs/ceph/mon_client.c
parent07bd10fb9853a41a7f0bb271721cca97d15eccae (diff)
ceph: warn on allocation from msgpool with larger front_len
Pass the front_len we need when pulling a message off a msgpool, and WARN if it is greater than the pool's size. Then try to allocate a new message (to continue without failing). Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mon_client.c')
-rw-r--r--fs/ceph/mon_client.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c
index d52e52968d01..e6e954cac6b9 100644
--- a/fs/ceph/mon_client.c
+++ b/fs/ceph/mon_client.c
@@ -639,14 +639,15 @@ static struct ceph_msg *mon_alloc_msg(struct ceph_connection *con,
639{ 639{
640 struct ceph_mon_client *monc = con->private; 640 struct ceph_mon_client *monc = con->private;
641 int type = le16_to_cpu(hdr->type); 641 int type = le16_to_cpu(hdr->type);
642 int front = le32_to_cpu(hdr->front_len);
642 643
643 switch (type) { 644 switch (type) {
644 case CEPH_MSG_CLIENT_MOUNT_ACK: 645 case CEPH_MSG_CLIENT_MOUNT_ACK:
645 return ceph_msgpool_get(&monc->msgpool_mount_ack); 646 return ceph_msgpool_get(&monc->msgpool_mount_ack, front);
646 case CEPH_MSG_MON_SUBSCRIBE_ACK: 647 case CEPH_MSG_MON_SUBSCRIBE_ACK:
647 return ceph_msgpool_get(&monc->msgpool_subscribe_ack); 648 return ceph_msgpool_get(&monc->msgpool_subscribe_ack, front);
648 case CEPH_MSG_STATFS_REPLY: 649 case CEPH_MSG_STATFS_REPLY:
649 return ceph_msgpool_get(&monc->msgpool_statfs_reply); 650 return ceph_msgpool_get(&monc->msgpool_statfs_reply, front);
650 } 651 }
651 return ceph_alloc_msg(con, hdr); 652 return ceph_alloc_msg(con, hdr);
652} 653}