aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2010-12-16 08:47:39 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 05:43:29 -0500
commit02851e9f00d78dbc8ded0aacbf9bf3b631d627b3 (patch)
treed7a5611fef479c13ff70cccace8f22a963ba6df8 /drivers/block/drbd
parent84e7c0f7d123d64d97e1f789ad2f23a72fe8981f (diff)
drbd: move bitmap write from resync_finished to after_state_change
We must not call it directly from resync_finished, as we may be in either receiver or worker context there. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r--drivers/block/drbd/drbd_main.c14
-rw-r--r--drivers/block/drbd/drbd_worker.c3
2 files changed, 10 insertions, 7 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 57ed7181742d..c6c7e3e6dc23 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1548,6 +1548,9 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
1548 if (os.disk < D_UP_TO_DATE && os.conn >= C_SYNC_SOURCE && ns.conn == C_CONNECTED) 1548 if (os.disk < D_UP_TO_DATE && os.conn >= C_SYNC_SOURCE && ns.conn == C_CONNECTED)
1549 drbd_send_state(mdev); 1549 drbd_send_state(mdev);
1550 1550
1551 if (os.conn > C_CONNECTED && ns.conn == C_CONNECTED)
1552 drbd_queue_bitmap_io(mdev, &drbd_bm_write, NULL, "write from resync_finished");
1553
1551 /* free tl_hash if we Got thawed and are C_STANDALONE */ 1554 /* free tl_hash if we Got thawed and are C_STANDALONE */
1552 if (ns.conn == C_STANDALONE && !is_susp(ns) && mdev->tl_hash) 1555 if (ns.conn == C_STANDALONE && !is_susp(ns) && mdev->tl_hash)
1553 drbd_free_tl_hash(mdev); 1556 drbd_free_tl_hash(mdev);
@@ -3860,13 +3863,16 @@ int drbd_bmio_clear_n_write(struct drbd_conf *mdev)
3860static int w_bitmap_io(struct drbd_conf *mdev, struct drbd_work *w, int unused) 3863static int w_bitmap_io(struct drbd_conf *mdev, struct drbd_work *w, int unused)
3861{ 3864{
3862 struct bm_io_work *work = container_of(w, struct bm_io_work, w); 3865 struct bm_io_work *work = container_of(w, struct bm_io_work, w);
3863 int rv; 3866 int rv = -EIO;
3864 3867
3865 D_ASSERT(atomic_read(&mdev->ap_bio_cnt) == 0); 3868 D_ASSERT(atomic_read(&mdev->ap_bio_cnt) == 0);
3866 3869
3867 drbd_bm_lock(mdev, work->why); 3870 if (get_ldev(mdev)) {
3868 rv = work->io_fn(mdev); 3871 drbd_bm_lock(mdev, work->why);
3869 drbd_bm_unlock(mdev); 3872 rv = work->io_fn(mdev);
3873 drbd_bm_unlock(mdev);
3874 put_ldev(mdev);
3875 }
3870 3876
3871 clear_bit(BITMAP_IO, &mdev->flags); 3877 clear_bit(BITMAP_IO, &mdev->flags);
3872 smp_mb__after_clear_bit(); 3878 smp_mb__after_clear_bit();
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index be46084c254e..2374454cdf17 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -907,9 +907,6 @@ out:
907 907
908 drbd_md_sync(mdev); 908 drbd_md_sync(mdev);
909 909
910 dev_info(DEV, "Writing changed bitmap pages\n");
911 drbd_queue_bitmap_io(mdev, &drbd_bm_write, NULL, "write from resync_finished");
912
913 if (khelper_cmd) 910 if (khelper_cmd)
914 drbd_khelper(mdev, khelper_cmd); 911 drbd_khelper(mdev, khelper_cmd);
915 912