diff options
Diffstat (limited to 'fs/ceph/mon_client.c')
-rw-r--r-- | fs/ceph/mon_client.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c index bea2be9077e4..d52e52968d01 100644 --- a/fs/ceph/mon_client.c +++ b/fs/ceph/mon_client.c | |||
@@ -199,10 +199,12 @@ static void handle_subscribe_ack(struct ceph_mon_client *monc, | |||
199 | struct ceph_msg *msg) | 199 | struct ceph_msg *msg) |
200 | { | 200 | { |
201 | unsigned seconds; | 201 | unsigned seconds; |
202 | void *p = msg->front.iov_base; | 202 | struct ceph_mon_subscribe_ack *h = msg->front.iov_base; |
203 | void *end = p + msg->front.iov_len; | 203 | |
204 | if (msg->front.iov_len < sizeof(*h)) | ||
205 | goto bad; | ||
206 | seconds = le32_to_cpu(h->duration); | ||
204 | 207 | ||
205 | ceph_decode_32_safe(&p, end, seconds, bad); | ||
206 | mutex_lock(&monc->mutex); | 208 | mutex_lock(&monc->mutex); |
207 | if (monc->hunting) { | 209 | if (monc->hunting) { |
208 | pr_info("mon%d %s session established\n", | 210 | pr_info("mon%d %s session established\n", |
@@ -541,7 +543,8 @@ int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl) | |||
541 | err = ceph_msgpool_init(&monc->msgpool_mount_ack, 4096, 1, false); | 543 | err = ceph_msgpool_init(&monc->msgpool_mount_ack, 4096, 1, false); |
542 | if (err < 0) | 544 | if (err < 0) |
543 | goto out; | 545 | goto out; |
544 | err = ceph_msgpool_init(&monc->msgpool_subscribe_ack, 8, 1, false); | 546 | err = ceph_msgpool_init(&monc->msgpool_subscribe_ack, |
547 | sizeof(struct ceph_mon_subscribe_ack), 1, false); | ||
545 | if (err < 0) | 548 | if (err < 0) |
546 | goto out; | 549 | goto out; |
547 | err = ceph_msgpool_init(&monc->msgpool_statfs_reply, | 550 | err = ceph_msgpool_init(&monc->msgpool_statfs_reply, |