diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2011-09-26 09:58:04 +0200 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 16:58:04 +0100 |
commit | 22d81140aea85f9ac388fa12768dc502ef00eaae (patch) | |
tree | baf5997bf31c726f648a27c9d817e16ce2ed9e50 /drivers/block/drbd/drbd_bitmap.c | |
parent | drbd: Consider the discard-my-data flag for all volumes [bugz 359] (diff) | |
download | linux-22d81140aea85f9ac388fa12768dc502ef00eaae.tar.xz linux-22d81140aea85f9ac388fa12768dc502ef00eaae.zip |
drbd: fix bitmap writeout after aborted resync
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.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 092f8273e6bd..fcbc5e1ca50d 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -1448,13 +1448,21 @@ static inline void bm_set_full_words_within_one_page(struct drbd_bitmap *b, { int i; int bits; + int changed = 0; unsigned long *paddr = kmap_atomic(b->bm_pages[page_nr], KM_IRQ1); for (i = first_word; i < last_word; i++) { bits = hweight_long(paddr[i]); paddr[i] = ~0UL; - b->bm_set += BITS_PER_LONG - bits; + changed += BITS_PER_LONG - bits; } kunmap_atomic(paddr, KM_IRQ1); + if (changed) { + /* We only need lazy writeout, the information is still in the + * remote bitmap as well, and is reconstructed during the next + * bitmap exchange, if lost locally due to a crash. */ + bm_set_page_lazy_writeout(b->bm_pages[page_nr]); + b->bm_set += changed; + } } /* Same thing as drbd_bm_set_bits, |