Commit 6ab9b1b6 authored by Philipp Reisner's avatar Philipp Reisner

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: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent b8853dbd
...@@ -1325,7 +1325,9 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, ...@@ -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", "ASSERT FAILED: disk is %s during detach\n",
drbd_disk_str(mdev->state.disk)); drbd_disk_str(mdev->state.disk));
if (ns.conn >= C_CONNECTED)
drbd_send_state(mdev, ns); drbd_send_state(mdev, ns);
drbd_rs_cancel_all(mdev); drbd_rs_cancel_all(mdev);
/* In case we want to get something to stable storage still, /* In case we want to get something to stable storage still,
...@@ -1353,6 +1355,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, ...@@ -1353,6 +1355,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
mdev->rs_failed = 0; mdev->rs_failed = 0;
atomic_set(&mdev->rs_pending_cnt, 0); atomic_set(&mdev->rs_pending_cnt, 0);
if (ns.conn >= C_CONNECTED)
drbd_send_state(mdev, ns); drbd_send_state(mdev, ns);
/* corresponding get_ldev in __drbd_set_state /* corresponding get_ldev in __drbd_set_state
* this may finally trigger drbd_ldev_destroy. */ * this may finally trigger drbd_ldev_destroy. */
...@@ -1360,7 +1363,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, ...@@ -1360,7 +1363,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
} }
/* Notify peer that I had a local IO error, and did not detached.. */ /* 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); drbd_send_state(mdev, ns);
/* Disks got bigger while they were detached */ /* Disks got bigger while they were detached */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment