aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_receiver.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-09-08 17:20:21 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-10-14 12:38:40 -0400
commitfb22c402ffdf61dd121795b5809de587185d5240 (patch)
tree7c3de5410eff21b3a3b105dc63d5e2034f2c7c63 /drivers/block/drbd/drbd_receiver.c
parent78db89287ce0f146a1f2a019a0b243ea4557caac (diff)
drbd: Track the reasons to suspend IO in dedicated state bits
There are three ways to get IO suspended: * Loss of any access to data * Fence-peer-handler running * User requested to suspend IO Track those in different bits, so that one condition clearing its state bit does not interfere with the other two conditions. Only when the user resumes IO he overrules all three bits. The fact is hidden from the user, he sees only a single suspend bit. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r--drivers/block/drbd/drbd_receiver.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 983e49cbd233..6b69b2f734dc 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -3315,7 +3315,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
3315 if ((nconn == C_CONNECTED || nconn == C_WF_BITMAP_S) && ns.disk == D_NEGOTIATING) 3315 if ((nconn == C_CONNECTED || nconn == C_WF_BITMAP_S) && ns.disk == D_NEGOTIATING)
3316 ns.disk = mdev->new_state_tmp.disk; 3316 ns.disk = mdev->new_state_tmp.disk;
3317 cs_flags = CS_VERBOSE + (oconn < C_CONNECTED && nconn >= C_CONNECTED ? 0 : CS_HARD); 3317 cs_flags = CS_VERBOSE + (oconn < C_CONNECTED && nconn >= C_CONNECTED ? 0 : CS_HARD);
3318 if (ns.pdsk == D_CONSISTENT && ns.susp && nconn == C_CONNECTED && oconn < C_CONNECTED && 3318 if (ns.pdsk == D_CONSISTENT && is_susp(ns) && nconn == C_CONNECTED && oconn < C_CONNECTED &&
3319 test_bit(NEW_CUR_UUID, &mdev->flags)) { 3319 test_bit(NEW_CUR_UUID, &mdev->flags)) {
3320 /* Do not allow tl_restart(resend) for a rebooted peer. We can only allow this 3320 /* Do not allow tl_restart(resend) for a rebooted peer. We can only allow this
3321 for temporal network outages! */ 3321 for temporal network outages! */
@@ -3829,7 +3829,7 @@ static void drbd_disconnect(struct drbd_conf *mdev)
3829 kfree(mdev->p_uuid); 3829 kfree(mdev->p_uuid);
3830 mdev->p_uuid = NULL; 3830 mdev->p_uuid = NULL;
3831 3831
3832 if (!mdev->state.susp) 3832 if (!is_susp(mdev->state))
3833 tl_clear(mdev); 3833 tl_clear(mdev);
3834 3834
3835 dev_info(DEV, "Connection closed\n"); 3835 dev_info(DEV, "Connection closed\n");
@@ -3858,7 +3858,7 @@ static void drbd_disconnect(struct drbd_conf *mdev)
3858 if (os.conn == C_DISCONNECTING) { 3858 if (os.conn == C_DISCONNECTING) {
3859 wait_event(mdev->net_cnt_wait, atomic_read(&mdev->net_cnt) == 0); 3859 wait_event(mdev->net_cnt_wait, atomic_read(&mdev->net_cnt) == 0);
3860 3860
3861 if (!mdev->state.susp) { 3861 if (!is_susp(mdev->state)) {
3862 /* we must not free the tl_hash 3862 /* we must not free the tl_hash
3863 * while application io is still on the fly */ 3863 * while application io is still on the fly */
3864 wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_bio_cnt)); 3864 wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_bio_cnt));