diff options
author | NeilBrown <neilb@suse.de> | 2010-06-01 05:37:26 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-07-25 22:52:27 -0400 |
commit | 676e42d896ab6967859fabbb06f4e11b9615cbcf (patch) | |
tree | efab4dffe8e930ec9ef51a5a4d4fd04ffe3749b1 /drivers/md/bitmap.c | |
parent | f4be6b43f1ac60dff00ef0923ee43b0e08872947 (diff) |
md: be more careful setting MD_CHANGE_CLEAN
When MD_CHANGE_CLEAN is set we might block in md_write_start.
So we should only set it when fairly sure that something will clear
it.
There are two places where it is set so as to encourage a metadata
update to record the progress of resync/recovery. This should only
be done if the internal metadata update mechanisms are in use, which
can be tested by by inspecting '->persistent'.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r-- | drivers/md/bitmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 1742435ce3ae..4518994712c7 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1526,7 +1526,8 @@ void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector) | |||
1526 | atomic_read(&bitmap->mddev->recovery_active) == 0); | 1526 | atomic_read(&bitmap->mddev->recovery_active) == 0); |
1527 | 1527 | ||
1528 | bitmap->mddev->curr_resync_completed = bitmap->mddev->curr_resync; | 1528 | bitmap->mddev->curr_resync_completed = bitmap->mddev->curr_resync; |
1529 | set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags); | 1529 | if (bitmap->mddev->persistent) |
1530 | set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags); | ||
1530 | sector &= ~((1ULL << CHUNK_BLOCK_SHIFT(bitmap)) - 1); | 1531 | sector &= ~((1ULL << CHUNK_BLOCK_SHIFT(bitmap)) - 1); |
1531 | s = 0; | 1532 | s = 0; |
1532 | while (s < sector && s < bitmap->mddev->resync_max_sectors) { | 1533 | while (s < sector && s < bitmap->mddev->resync_max_sectors) { |