diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2015-11-27 19:23:24 +0100 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2016-01-21 11:23:28 -0500 |
commit | ebf6b5329105efecf9b9dfc45d486b97cecbf86e (patch) | |
tree | bf2debbdbea550097bd2f05f5b1328a09bca072b | |
parent | c0cdea628d04f529189ae4fa84ce7abfefe938e3 (diff) | |
download | lwn-ebf6b5329105efecf9b9dfc45d486b97cecbf86e.tar.gz lwn-ebf6b5329105efecf9b9dfc45d486b97cecbf86e.zip |
rbd: don't put snap_context twice in rbd_queue_workfn()
[ Upstream commit 70b16db86f564977df074072143284aec2cb1162 ]
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.
Cc: stable@vger.kernel.org # 3.18+
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r-- | drivers/block/rbd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 8f51d6e3883e..f8045dbb73e3 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -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, |