aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_state.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-12-13 18:32:18 +0100
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 16:58:12 +0100
commit6ab9b1b60b1854bf5fe68ecd51cb9550c67801ec (patch)
treec2fd2288f66aa8b6c27cad33535192c6435b895f /drivers/block/drbd/drbd_state.c
parentb8853dbd8c6410d1faef2785e8ee4c990b068a77 (diff)
downloadvexpress-lsk-6ab9b1b60b1854bf5fe68ecd51cb9550c67801ec.tar.gz
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/drbd_state.c')
-rw-r--r--drivers/block/drbd/drbd_state.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index 58c77bbae44..507cfccc1be 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -1325,7 +1325,9 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
"ASSERT FAILED: disk is %s during detach\n",
drbd_disk_str(mdev->state.disk));
- drbd_send_state(mdev, ns);
+ if (ns.conn >= C_CONNECTED)
+ drbd_send_state(mdev, ns);
+
drbd_rs_cancel_all(mdev);
/* In case we want to get something to stable storage still,
@@ -1353,14 +1355,15 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
mdev->rs_failed = 0;
atomic_set(&mdev->rs_pending_cnt, 0);
- drbd_send_state(mdev, ns);
+ if (ns.conn >= C_CONNECTED)
+ drbd_send_state(mdev, ns);
/* corresponding get_ldev in __drbd_set_state
* this may finally trigger drbd_ldev_destroy. */
put_ldev(mdev);
}
/* Notify peer that I had a local IO error, and did not detached.. */
- if (os.disk == D_UP_TO_DATE && ns.disk == D_INCONSISTENT)
+ if (os.disk == D_UP_TO_DATE && ns.disk == D_INCONSISTENT && ns.conn >= C_CONNECTED)
drbd_send_state(mdev, ns);
/* Disks got bigger while they were detached */