drbd: fix conn_reconfig_start without conn_reconfig_done in drbd_adm_attach
authorLars Ellenberg <lars.ellenberg@linbit.com>
Wed, 16 Mar 2011 15:52:10 +0000 (16:52 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Sat, 3 Nov 2012 23:16:31 +0000 (00:16 +0100)
If drbd_adm_attach failed early, it left the CONFIG_PENDING bit on,
blocking any further conn_reconfig_start on that connection.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_nl.c

index d952e877f8d5330a1c459ad5a0bad7b43cdedb38..daf388f4bd174fbe7d5ba23d1ba19d388d6d4c51 100644 (file)
@@ -1041,7 +1041,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info)
        if (!adm_ctx.reply_skb)
                return retcode;
        if (retcode != NO_ERROR)
-               goto fail;
+               goto finish;
 
        mdev = adm_ctx.mdev;
        conn_reconfig_start(mdev->tconn);
@@ -1400,8 +1400,8 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info)
  force_diskless:
        drbd_force_state(mdev, NS(disk, D_FAILED));
        drbd_md_sync(mdev);
-       conn_reconfig_done(mdev->tconn);
  fail:
+       conn_reconfig_done(mdev->tconn);
        if (nbc) {
                if (nbc->backing_bdev)
                        blkdev_put(nbc->backing_bdev,
@@ -1413,6 +1413,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info)
        }
        lc_destroy(resync_lru);
 
+ finish:
        drbd_adm_finish(info, retcode);
        return 0;
 }