diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2011-01-12 05:51:13 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:47:52 -0500 |
commit | 6c922ed543bee1bc6685ade07be59f3fa49a7288 (patch) | |
tree | 1a2b0c13be822da96a6335953cca9cd06d1b7e1b /drivers/block/drbd/drbd_worker.c | |
parent | 20ee639024e3d33111df0e343050b218c656bf16 (diff) |
drbd: only generate and send a new sync uuid after a successful state change
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_worker.c')
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 7b3d4dc4af84..ec42e04bb517 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -1544,24 +1544,23 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) | |||
1544 | } | 1544 | } |
1545 | write_unlock_irq(&global_state_lock); | 1545 | write_unlock_irq(&global_state_lock); |
1546 | 1546 | ||
1547 | if (side == C_SYNC_TARGET) | ||
1548 | mdev->bm_resync_fo = 0; | ||
1549 | |||
1550 | /* Since protocol 96, we must serialize drbd_gen_and_send_sync_uuid | ||
1551 | * with w_send_oos, or the sync target will get confused as to | ||
1552 | * how much bits to resync. We cannot do that always, because for an | ||
1553 | * empty resync and protocol < 95, we need to do it here, as we call | ||
1554 | * drbd_resync_finished from here in that case. | ||
1555 | * We drbd_gen_and_send_sync_uuid here for protocol < 96, | ||
1556 | * and from after_state_ch otherwise. */ | ||
1557 | if (side == C_SYNC_SOURCE && mdev->agreed_pro_version < 96) | ||
1558 | drbd_gen_and_send_sync_uuid(mdev); | ||
1559 | |||
1560 | if (r == SS_SUCCESS) { | 1547 | if (r == SS_SUCCESS) { |
1561 | dev_info(DEV, "Began resync as %s (will sync %lu KB [%lu bits set]).\n", | 1548 | dev_info(DEV, "Began resync as %s (will sync %lu KB [%lu bits set]).\n", |
1562 | drbd_conn_str(ns.conn), | 1549 | drbd_conn_str(ns.conn), |
1563 | (unsigned long) mdev->rs_total << (BM_BLOCK_SHIFT-10), | 1550 | (unsigned long) mdev->rs_total << (BM_BLOCK_SHIFT-10), |
1564 | (unsigned long) mdev->rs_total); | 1551 | (unsigned long) mdev->rs_total); |
1552 | if (side == C_SYNC_TARGET) | ||
1553 | mdev->bm_resync_fo = 0; | ||
1554 | |||
1555 | /* Since protocol 96, we must serialize drbd_gen_and_send_sync_uuid | ||
1556 | * with w_send_oos, or the sync target will get confused as to | ||
1557 | * how much bits to resync. We cannot do that always, because for an | ||
1558 | * empty resync and protocol < 95, we need to do it here, as we call | ||
1559 | * drbd_resync_finished from here in that case. | ||
1560 | * We drbd_gen_and_send_sync_uuid here for protocol < 96, | ||
1561 | * and from after_state_ch otherwise. */ | ||
1562 | if (side == C_SYNC_SOURCE && mdev->agreed_pro_version < 96) | ||
1563 | drbd_gen_and_send_sync_uuid(mdev); | ||
1565 | 1564 | ||
1566 | if (mdev->agreed_pro_version < 95 && mdev->rs_total == 0) { | 1565 | if (mdev->agreed_pro_version < 95 && mdev->rs_total == 0) { |
1567 | /* This still has a race (about when exactly the peers | 1566 | /* This still has a race (about when exactly the peers |