From: Ilya Dryomov Date: Fri, 27 Nov 2015 18:23:24 +0000 (+0100) Subject: rbd: don't put snap_context twice in rbd_queue_workfn() X-Git-Tag: v4.3.3~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d8dce2c10dfaba12c767e48d254082333424c7e;p=thirdparty%2Fkernel%2Fstable.git rbd: don't put snap_context twice in rbd_queue_workfn() commit 70b16db86f564977df074072143284aec2cb1162 upstream. Commit 4e752f0ab0e8 ("rbd: access snapshot context and mapping size safely") moved ceph_get_snap_context() out of rbd_img_request_create() and into rbd_queue_workfn(), adding a ceph_put_snap_context() to the error path in rbd_queue_workfn(). However, rbd_img_request_create() consumes a ref on snapc, so calling ceph_put_snap_context() after a successful rbd_img_request_create() leads to an extra put. Fix it. Signed-off-by: Ilya Dryomov Reviewed-by: Josh Durgin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 128e7df5b8072..8630a77ea4625 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3444,6 +3444,7 @@ static void rbd_queue_workfn(struct work_struct *work) goto err_rq; } img_request->rq = rq; + snapc = NULL; /* img_request consumes a ref */ if (op_type == OBJ_OP_DISCARD) result = rbd_img_request_fill(img_request, OBJ_REQUEST_NODATA,