diff mbox

[04/24] md: be more careful setting MD_CHANGE_CLEAN

Message ID 20100601095618.565.67698.stgit@notabene.brown (mailing list archive)
State Accepted, archived
Delegated to: Jonthan Brassow
Headers show

Commit Message

NeilBrown June 1, 2010, 9:56 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 1742435..4518994 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)
 		   atomic_read(&bitmap->mddev->recovery_active) == 0);
 
 	bitmap->mddev->curr_resync_completed = bitmap->mddev->curr_resync;
-	set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags);
+	if (bitmap->mddev->persistent)
+		set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags);
 	sector &= ~((1ULL << CHUNK_BLOCK_SHIFT(bitmap)) - 1);
 	s = 0;
 	while (s < sector && s < bitmap->mddev->resync_max_sectors) {
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 6fbd1c7..2337cb2 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6726,7 +6726,8 @@  void md_do_sync(mddev_t *mddev)
 				   atomic_read(&mddev->recovery_active) == 0);
 			mddev->curr_resync_completed =
 				mddev->curr_resync;
-			set_bit(MD_CHANGE_CLEAN, &mddev->flags);
+			if (mddev->persistent)
+				set_bit(MD_CHANGE_CLEAN, &mddev->flags);
 			sysfs_notify(&mddev->kobj, NULL, "sync_completed");
 		}