|
@@ -1924,14 +1924,14 @@ int bitmap_copy_from_slot(struct mddev *mddev, int slot,
|
|
|
|
|
|
if (clear_bits) {
|
|
|
bitmap_update_sb(bitmap);
|
|
|
- /* Setting this for the ev_page should be enough.
|
|
|
- * And we do not require both write_all and PAGE_DIRT either
|
|
|
- */
|
|
|
+ /* BITMAP_PAGE_PENDING is set, but bitmap_unplug needs
|
|
|
+ * BITMAP_PAGE_DIRTY or _NEEDWRITE to write ... */
|
|
|
for (i = 0; i < bitmap->storage.file_pages; i++)
|
|
|
- set_page_attr(bitmap, i, BITMAP_PAGE_DIRTY);
|
|
|
- bitmap_write_all(bitmap);
|
|
|
+ if (test_page_attr(bitmap, i, BITMAP_PAGE_PENDING))
|
|
|
+ set_page_attr(bitmap, i, BITMAP_PAGE_NEEDWRITE);
|
|
|
bitmap_unplug(bitmap);
|
|
|
}
|
|
|
+ bitmap_unplug(mddev->bitmap);
|
|
|
*low = lo;
|
|
|
*high = hi;
|
|
|
err:
|