|
@@ -1216,6 +1216,13 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
|
|
|
/* Do not change the order of the if above and the two below... */
|
|
|
if (os.pdsk == D_DISKLESS &&
|
|
|
ns.pdsk > D_DISKLESS && ns.pdsk != D_UNKNOWN) { /* attach on the peer */
|
|
|
+ /* we probably will start a resync soon.
|
|
|
+ * make sure those things are properly reset. */
|
|
|
+ mdev->rs_total = 0;
|
|
|
+ mdev->rs_failed = 0;
|
|
|
+ atomic_set(&mdev->rs_pending_cnt, 0);
|
|
|
+ drbd_rs_cancel_all(mdev);
|
|
|
+
|
|
|
drbd_send_uuids(mdev);
|
|
|
drbd_send_state(mdev, ns);
|
|
|
}
|
|
@@ -1386,10 +1393,6 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
|
|
|
"ASSERT FAILED: disk is %s while going diskless\n",
|
|
|
drbd_disk_str(mdev->state.disk));
|
|
|
|
|
|
- mdev->rs_total = 0;
|
|
|
- mdev->rs_failed = 0;
|
|
|
- atomic_set(&mdev->rs_pending_cnt, 0);
|
|
|
-
|
|
|
if (ns.conn >= C_CONNECTED)
|
|
|
drbd_send_state(mdev, ns);
|
|
|
/* corresponding get_ldev in __drbd_set_state
|