rbd: don't put snap_context twice in rbd_queue_workfn()
authorIlya Dryomov <idryomov@gmail.com>
Fri, 27 Nov 2015 18:23:24 +0000 (19:23 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 4 Dec 2015 13:29:18 +0000 (14:29 +0100)
commit70b16db86f564977df074072143284aec2cb1162
treeeb4418d39ce759952bf36e5536efbe06e94134a9
parent31ade3b83e1821da5fbb2f11b5b3d4ab2ec39db8
rbd: don't put snap_context twice in rbd_queue_workfn()

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>
drivers/block/rbd.c