]> git.ipfire.org Git - people/ms/linux.git/commit
rbd: don't destroy ceph_opts in rbd_add()
authorAlex Elder <elder@inktank.com>
Thu, 16 May 2013 20:04:20 +0000 (15:04 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Jun 2013 19:01:28 +0000 (12:01 -0700)
commit528a7a8bf60a2a2aa3c10a6f1e6c03b4fd1f1f09
treeda9975a9704a35f987580fd8a0c431247c56269f
parent4a798296068abd043608c10ccb69209a7c2f0579
rbd: don't destroy ceph_opts in rbd_add()

commit 7262cfca430a1a0e0707149af29ae86bc0ded230 upstream.

Whether rbd_client_create() successfully creates a new client or
not, it takes responsibility for getting the ceph_opts structure
it's passed destroyed.  If successful, the structure becomes
associated with the created client; if not, rbd_client_create()
will destroy it.

Previously, rbd_get_client() would call ceph_destroy_options()
if rbd_get_client() failed, and that meant it got called twice.
That led freeing various pointers more than once, which is never a
good idea.

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

Reported-by: Dan van der Ster <dan@vanderster.com>
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/rbd.c