A couple of issues addressed: - obj_request put before get. - stat_request leaked, including payload pages. Fixes: c5b5ef6c5 ("rbd: issue stat request before layered write") Signed-off-by: David Disseldorp <ddiss@xxxxxxx> --- drivers/block/rbd.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 93d6200..970fea6 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2858,8 +2858,10 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request) ret = -ENOMEM; stat_request = rbd_obj_request_create(obj_request->object_name, 0, 0, OBJ_REQUEST_PAGES); - if (!stat_request) + if (!stat_request) { + ceph_release_page_vector(pages, page_count); goto out; + } rbd_obj_request_get(obj_request); stat_request->obj_request = obj_request; @@ -2871,7 +2873,7 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request) stat_request->osd_req = rbd_osd_req_create(rbd_dev, OBJ_OP_READ, 1, stat_request); if (!stat_request->osd_req) - goto out; + goto out_cleanup; stat_request->callback = rbd_img_obj_exists_callback; osd_req_op_init(stat_request->osd_req, 0, CEPH_OSD_OP_STAT, 0); @@ -2885,10 +2887,13 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request) osdc = &rbd_dev->rbd_client->client->osdc; ret = rbd_obj_request_submit(osdc, stat_request); -out: - if (ret) +out_cleanup: + if (ret) { rbd_obj_request_put(obj_request); - + stat_request->img_request = NULL; + rbd_obj_request_put(stat_request); + } +out: return ret; } -- 2.6.6 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html