aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_bitmap.c
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2012-05-07 06:07:18 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 10:58:28 -0500
commita220d291804233e3a5e3425abf79fa1e62e7bd35 (patch)
tree1a1c851e0a21de3acbff2a780bfb2d3ce5dd8760 /drivers/block/drbd/drbd_bitmap.c
parent5016b82a49eb06cbe2002db7bd8a5501ba4ef6d1 (diff)
drbd: allow bitmap to change during writeout from resync_finished
Symptom: messages similar to "FIXME asender in bm_change_bits_to, bitmap locked for 'write from resync_finished' by worker" If a resync or verify is finished (or aborted), a full bitmap writeout is triggered. If we have ongoing local IO, the bitmap may still change during that writeout, pending and not yet processed acks may cause bits to be cleared, while new writes may cause bits to be to be set. To fix this, introduce the drbd_bm_write_copy_pages() variant. 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_bitmap.c')
-rw-r--r--drivers/block/drbd/drbd_bitmap.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c
index e343817bc69e..ddd297708194 100644
--- a/drivers/block/drbd/drbd_bitmap.c
+++ b/drivers/block/drbd/drbd_bitmap.c
@@ -1191,6 +1191,22 @@ int drbd_bm_write_lazy(struct drbd_conf *mdev, unsigned upper_idx) __must_hold(l
1191} 1191}
1192 1192
1193/** 1193/**
1194 * drbd_bm_write_copy_pages() - Write the whole bitmap to its on disk location.
1195 * @mdev: DRBD device.
1196 *
1197 * Will only write pages that have changed since last IO.
1198 * In contrast to drbd_bm_write(), this will copy the bitmap pages
1199 * to temporary writeout pages. It is intended to trigger a full write-out
1200 * while still allowing the bitmap to change, for example if a resync or online
1201 * verify is aborted due to a failed peer disk, while local IO continues, or
1202 * pending resync acks are still being processed.
1203 */
1204int drbd_bm_write_copy_pages(struct drbd_conf *mdev) __must_hold(local)
1205{
1206 return bm_rw(mdev, WRITE, BM_AIO_COPY_PAGES, 0);
1207}
1208
1209/**
1194 * drbd_bm_write_hinted() - Write bitmap pages with "hint" marks, if they have changed. 1210 * drbd_bm_write_hinted() - Write bitmap pages with "hint" marks, if they have changed.
1195 * @mdev: DRBD device. 1211 * @mdev: DRBD device.
1196 */ 1212 */