Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebf6b532 authored by Ilya Dryomov's avatar Ilya Dryomov Committed by Sasha Levin
Browse files

rbd: don't put snap_context twice in rbd_queue_workfn()



[ Upstream commit 70b16db86f564977df074072143284aec2cb1162 ]

Commit 4e752f0a ("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: default avatarIlya Dryomov <idryomov@gmail.com>
Reviewed-by: default avatarJosh Durgin <jdurgin@redhat.com>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent c0cdea62
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3394,6 +3394,7 @@ static void rbd_handle_request(struct rbd_device *rbd_dev, struct request *rq)
		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,