rbd: tear down watch request if rbd_dev_device_setup() fails
authorIlya Dryomov <ilya.dryomov@inktank.com>
Mon, 16 Dec 2013 16:02:41 +0000 (18:02 +0200)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 31 Dec 2013 18:32:07 +0000 (20:32 +0200)
Tear down watch request if rbd_dev_device_setup() fails.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c

index d078d2352c77616c60a48a304ede38b9eafd4d2a..72a7eec456a99a102f2d2abeab2d1a2e1f273a8e 100644 (file)
@@ -5143,6 +5143,12 @@ static ssize_t do_rbd_add(struct bus_type *bus,
 
        rc = rbd_dev_device_setup(rbd_dev);
        if (rc) {
+               /*
+                * rbd_dev_header_unwatch_sync() can't be moved into
+                * rbd_dev_image_release() without refactoring, see
+                * commit 1f3ef78861ac.
+                */
+               rbd_dev_header_unwatch_sync(rbd_dev);
                rbd_dev_image_release(rbd_dev);
                goto err_out_module;
        }