diff options
| author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2011-03-10 23:33:15 +0100 |
|---|---|---|
| committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-04 00:16:20 +0100 |
| commit | cffec5b2fe8e851f54bb67a9012add062a97b960 (patch) | |
| tree | 3b6c837451f1c8e9a0f515e9efb2e21341c5b7ec /drivers/block | |
| parent | d0456c72df5fb3b800ba9b0ec2465fdbcaf29a7f (diff) | |
drbd: Allow a Diskless Secondary volume to be removed
Even if the connection is still established.
We should be able to reduce a volume from a replication group,
without taking the whole group offline.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
| -rw-r--r-- | drivers/block/drbd/drbd_nl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 244085ac12cc..9b0312f2d2f8 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -220,6 +220,8 @@ static int drbd_adm_prepare(struct sk_buff *skb, struct genl_info *info, drbd_msg_put_info("over-determined configuration context mismatch"); return ERR_INVALID_REQUEST; } + if (adm_ctx.mdev && !adm_ctx.tconn) + adm_ctx.tconn = adm_ctx.mdev->tconn; return NO_ERROR; fail: @@ -2643,10 +2645,15 @@ int drbd_adm_delete_minor(struct sk_buff *skb, struct genl_info *info) mdev = adm_ctx.mdev; if (mdev->state.disk == D_DISKLESS && - mdev->state.conn == C_STANDALONE && + /* no need to be mdev->state.conn == C_STANDALONE && + * we may want to delete a minor from a live replication group. + */ mdev->state.role == R_SECONDARY) { drbd_delete_device(mdev_to_minor(mdev)); retcode = NO_ERROR; + /* if this was the last volume of this connection, + * this will terminate all threads */ + conn_reconfig_done(adm_ctx.tconn); } else retcode = ERR_MINOR_CONFIGURED; out: |
