aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2010-12-18 11:00:59 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 05:43:40 -0500
commit06d33e968d2c58143a7aaafa8963cf6a58099467 (patch)
tree4380d4060178a44ea0e4d56a47d1fff1a43e7b86 /drivers/block
parent418e0a927d520f9c8e875ea75abee35d93a0f1b3 (diff)
drbd: improve on bitmap write out timing
Even though we now track the need for bitmap writeout per bitmap page, there is no need to trigger the writeout while a resync is going on. Once the resync is finished (or aborted), we trigger bitmap writeout anyways. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/drbd/drbd_main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index f529c25e1ad5..755297a15633 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1439,7 +1439,11 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
1439 put_ldev(mdev); 1439 put_ldev(mdev);
1440 } 1440 }
1441 1441
1442 if (os.role == R_PRIMARY && ns.role == R_SECONDARY && get_ldev(mdev)) { 1442 /* Write out all changed bits on demote.
1443 * Though, no need to da that just yet
1444 * if there is a resync going on still */
1445 if (os.role == R_PRIMARY && ns.role == R_SECONDARY &&
1446 mdev->state.conn <= C_CONNECTED && get_ldev(mdev)) {
1443 drbd_bitmap_io_from_worker(mdev, &drbd_bm_write, "demote"); 1447 drbd_bitmap_io_from_worker(mdev, &drbd_bm_write, "demote");
1444 put_ldev(mdev); 1448 put_ldev(mdev);
1445 } 1449 }
@@ -1559,7 +1563,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
1559 if (os.disk < D_UP_TO_DATE && os.conn >= C_SYNC_SOURCE && ns.conn == C_CONNECTED) 1563 if (os.disk < D_UP_TO_DATE && os.conn >= C_SYNC_SOURCE && ns.conn == C_CONNECTED)
1560 drbd_send_state(mdev); 1564 drbd_send_state(mdev);
1561 1565
1562 if (os.conn > C_CONNECTED && ns.conn == C_CONNECTED) 1566 if (os.conn > C_CONNECTED && ns.conn <= C_CONNECTED)
1563 drbd_queue_bitmap_io(mdev, &drbd_bm_write, NULL, "write from resync_finished"); 1567 drbd_queue_bitmap_io(mdev, &drbd_bm_write, NULL, "write from resync_finished");
1564 1568
1565 /* free tl_hash if we Got thawed and are C_STANDALONE */ 1569 /* free tl_hash if we Got thawed and are C_STANDALONE */