aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-12-13 04:31:32 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-05-09 09:16:29 -0400
commit4afc433cf8066c112bd2bdd949d78ff8e8b4ba3f (patch)
tree2919bdbaf204cb54b489988d1af2101f8d320af4 /drivers/block/drbd
parent545752d5d8a2e01b4fcb23a61ec732b2b26cbe1a (diff)
drbd: Do not send state packets while lower than C_CONNECTED cstate
I.e. in C_WF_REPORT_PARAMS or in C_WF_CONNECTION. Sending may already work in these cstates, but the peer still expects the HandShake / ConnectionFeatures packet. Actually triggered by the Testuite on kugel. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r--drivers/block/drbd/drbd_main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index f71a667f5f32..b2c0e5f0d52c 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1612,8 +1612,8 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
1612 "ASSERT FAILED: disk is %s during detach\n", 1612 "ASSERT FAILED: disk is %s during detach\n",
1613 drbd_disk_str(mdev->state.disk)); 1613 drbd_disk_str(mdev->state.disk));
1614 1614
1615 if (drbd_send_state(mdev, ns)) 1615 if (ns.conn >= C_CONNECTED)
1616 dev_info(DEV, "Notified peer that I am detaching my disk\n"); 1616 drbd_send_state(mdev, ns);
1617 1617
1618 drbd_rs_cancel_all(mdev); 1618 drbd_rs_cancel_all(mdev);
1619 1619
@@ -1642,15 +1642,16 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
1642 mdev->rs_failed = 0; 1642 mdev->rs_failed = 0;
1643 atomic_set(&mdev->rs_pending_cnt, 0); 1643 atomic_set(&mdev->rs_pending_cnt, 0);
1644 1644
1645 if (drbd_send_state(mdev, ns)) 1645 if (ns.conn >= C_CONNECTED)
1646 dev_info(DEV, "Notified peer that I'm now diskless.\n"); 1646 drbd_send_state(mdev, ns);
1647
1647 /* corresponding get_ldev in __drbd_set_state 1648 /* corresponding get_ldev in __drbd_set_state
1648 * this may finally trigger drbd_ldev_destroy. */ 1649 * this may finally trigger drbd_ldev_destroy. */
1649 put_ldev(mdev); 1650 put_ldev(mdev);
1650 } 1651 }
1651 1652
1652 /* Notify peer that I had a local IO error, and did not detached.. */ 1653 /* Notify peer that I had a local IO error, and did not detached.. */
1653 if (os.disk == D_UP_TO_DATE && ns.disk == D_INCONSISTENT) 1654 if (os.disk == D_UP_TO_DATE && ns.disk == D_INCONSISTENT && ns.conn >= C_CONNECTED)
1654 drbd_send_state(mdev, ns); 1655 drbd_send_state(mdev, ns);
1655 1656
1656 /* Disks got bigger while they were detached */ 1657 /* Disks got bigger while they were detached */