Skip to content

Commit

Permalink
drbd: Fixed bitmap in case of online-grow without resync
Browse files Browse the repository at this point in the history
The "surplus" bits of the old (smaller) bitmap must be clean
in case of online-grow without resync.

Note: Reverted 67ae8b80d4a116ab3b7094eb3723506b20c06dff as
well, since the lines added by this patch are redundant. The
bits get set by the bm_set_surplus(b) call before that.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
  • Loading branch information
Philipp Reisner committed May 17, 2010
1 parent 6b4388a commit 5223671
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/block/drbd/drbd_bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ int drbd_bm_resize(struct drbd_conf *mdev, sector_t capacity, int set_new_bits)
obits = b->bm_bits;

growing = bits > obits;
if (opages)
if (opages && growing && set_new_bits)
bm_set_surplus(b);

b->bm_pages = npages;
Expand All @@ -532,9 +532,6 @@ int drbd_bm_resize(struct drbd_conf *mdev, sector_t capacity, int set_new_bits)
if (set_new_bits) {
bm_memset(b, owords, 0xff, words-owords);
b->bm_set += bits - obits;
__bm_change_bits_to(mdev, obits,
ALIGN(obits, BITS_PER_LONG),
1, KM_IRQ1);
} else
bm_memset(b, owords, 0x00, words-owords);

Expand Down

0 comments on commit 5223671

Please sign in to comment.