libceph: initialize msgpool message types
Initialize the type field for messages in a msgpool. The caller was doing this for osd ops, but not for the reply messages. Reported-by: Alex Elder <elder@inktank.com> Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
@@ -242,6 +242,7 @@ struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
|
||||
}
|
||||
ceph_pagelist_init(req->r_trail);
|
||||
}
|
||||
|
||||
/* create request message; allow space for oid */
|
||||
msg_size += MAX_OBJ_NAME_SIZE;
|
||||
if (snapc)
|
||||
@@ -255,7 +256,6 @@ struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
msg->hdr.type = cpu_to_le16(CEPH_MSG_OSD_OP);
|
||||
memset(msg->front.iov_base, 0, msg->front.iov_len);
|
||||
|
||||
req->r_request = msg;
|
||||
@@ -1837,11 +1837,12 @@ int ceph_osdc_init(struct ceph_osd_client *osdc, struct ceph_client *client)
|
||||
if (!osdc->req_mempool)
|
||||
goto out;
|
||||
|
||||
err = ceph_msgpool_init(&osdc->msgpool_op, OSD_OP_FRONT_LEN, 10, true,
|
||||
err = ceph_msgpool_init(&osdc->msgpool_op, CEPH_MSG_OSD_OP,
|
||||
OSD_OP_FRONT_LEN, 10, true,
|
||||
"osd_op");
|
||||
if (err < 0)
|
||||
goto out_mempool;
|
||||
err = ceph_msgpool_init(&osdc->msgpool_op_reply,
|
||||
err = ceph_msgpool_init(&osdc->msgpool_op_reply, CEPH_MSG_OSD_OPREPLY,
|
||||
OSD_OPREPLY_FRONT_LEN, 10, true,
|
||||
"osd_op_reply");
|
||||
if (err < 0)
|
||||
|
Reference in New Issue
Block a user