Skip to content

Commit 70b16db

Browse files
committed
rbd: don't put snap_context twice in rbd_queue_workfn()
Commit 4e752f0 ("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. Cc: stable@vger.kernel.org # 3.18+ Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Josh Durgin <jdurgin@redhat.com>
1 parent 31ade3b commit 70b16db

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/block/rbd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3442,6 +3442,7 @@ static void rbd_queue_workfn(struct work_struct *work)
34423442
goto err_rq;
34433443
}
34443444
img_request->rq = rq;
3445+
snapc = NULL; /* img_request consumes a ref */
34453446

34463447
if (op_type == OBJ_OP_DISCARD)
34473448
result = rbd_img_request_fill(img_request, OBJ_REQUEST_NODATA,

0 commit comments

Comments
 (0)