diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-28 10:55:03 (GMT) |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 15:44:58 (GMT) |
commit | 778bcf2e290fc9f13735c32640cdafb34794ebd1 (patch) | |
tree | c86e4a14c423d88508299ebea7a5c3e5a7b0ca8f | |
parent | 435693e89b7a918b14ea67968971a2d8d9e88df2 (diff) | |
download | linux-fsl-qoriq-778bcf2e290fc9f13735c32640cdafb34794ebd1.tar.xz |
drbd: Allow to disconnect if one volume is diskless
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 2 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_state.c | 6 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_state.h | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 3243c78..b9bcb8b 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -3447,7 +3447,7 @@ static int receive_req_conn_state(struct drbd_tconn *tconn, struct packet_info * mask = convert_state(mask); val = convert_state(val); - rv = conn_request_state(tconn, mask, val, CS_VERBOSE | CS_LOCAL_ONLY); + rv = conn_request_state(tconn, mask, val, CS_VERBOSE | CS_LOCAL_ONLY | CS_IGN_OUTD_FAIL); conn_send_sr_reply(tconn, rv); return 0; diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index 164a7f8..ca77da3 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c @@ -1433,6 +1433,9 @@ conn_is_valid_transition(struct drbd_tconn *tconn, union drbd_state mask, union os = mdev->state; ns = sanitize_state(mdev, apply_mask_val(os, mask, val), NULL); + if (flags & CS_IGN_OUTD_FAIL && ns.disk == D_OUTDATED && os.disk < D_OUTDATED) + ns.disk = os.disk; + if (ns.i == os.i) continue; @@ -1475,6 +1478,9 @@ conn_set_state(struct drbd_tconn *tconn, union drbd_state mask, union drbd_state ns = apply_mask_val(os, mask, val); ns = sanitize_state(mdev, ns, NULL); + if (flags & CS_IGN_OUTD_FAIL && ns.disk == D_OUTDATED && os.disk < D_OUTDATED) + ns.disk = os.disk; + rv = __drbd_set_state(mdev, ns, flags, NULL); if (rv < SS_SUCCESS) BUG(); diff --git a/drivers/block/drbd/drbd_state.h b/drivers/block/drbd/drbd_state.h index 11fd0f8..c0331f1 100644 --- a/drivers/block/drbd/drbd_state.h +++ b/drivers/block/drbd/drbd_state.h @@ -69,6 +69,7 @@ enum chg_state_flags { CS_DC_DISK = 1 << 8, CS_DC_PDSK = 1 << 9, CS_DC_MASK = CS_DC_ROLE + CS_DC_PEER + CS_DC_CONN + CS_DC_DISK + CS_DC_PDSK, + CS_IGN_OUTD_FAIL = 1 << 10, }; extern enum drbd_state_rv drbd_change_state(struct drbd_conf *mdev, |