]> git.baikalelectronics.ru Git - kernel.git/commit
rbd: fix leak of format 2 snapshot context
authorAlex Elder <elder@inktank.com>
Mon, 6 May 2013 13:37:00 +0000 (08:37 -0500)
committerAlex Elder <elder@inktank.com>
Wed, 8 May 2013 12:38:30 +0000 (07:38 -0500)
commit413d8daebb19622ae47face379836933bdf9e2af
tree348c9a673077b2c43e07e75a12873d72a3920a29
parentd305ee6834ee54e7b4ef2ff386588627ab419e8e
rbd: fix leak of format 2 snapshot context

When rbd_dev_v2_refresh() is called, the rbd device already has a
snapshot context associated with it.  But that never gets freed,
the pointer just gets overwritten.

Fix this by dropping the rbd device's reference to the snapshot
context before overwriting the pointer.

Because ceph_put_snap_context() already handles for a null pointer
we don't need to check for that (for the probe case, where no
context has yet been assigned).

This resolves:
    http://tracker.ceph.com/issues/4912

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c