aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-08-27 04:23:49 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-08-27 14:01:31 -0400
commit84692195969b83f0ba57dc33ecf73e6c124dd186 (patch)
tree6ef3e71914c83cf66330f5c0cf6cf2edebb0404a /drivers/md
parent45f17e0c2ae05c133a348452690de0e5fa863293 (diff)
[PATCH] md: avoid backward event updates in md superblock when degraded.
If we - shut down a clean array, - restart with one (or more) drive(s) missing - make some changes - pause, so that they array gets marked 'clean', the event count on the superblock of included drives will be the same as that of the removed drives. So adding the removed drive back in will cause it to be included with no resync. To avoid this, we only update the eventcount backwards when the array is not degraded. In this case there can (should) be no non-connected drives that we can get confused with, and this is the particular case where updating-backwards is valuable. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b6d16022a53e..8dbab2ef3885 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1597,6 +1597,19 @@ void md_update_sb(mddev_t * mddev)
1597 1597
1598repeat: 1598repeat:
1599 spin_lock_irq(&mddev->write_lock); 1599 spin_lock_irq(&mddev->write_lock);
1600
1601 if (mddev->degraded && mddev->sb_dirty == 3)
1602 /* If the array is degraded, then skipping spares is both
1603 * dangerous and fairly pointless.
1604 * Dangerous because a device that was removed from the array
1605 * might have a event_count that still looks up-to-date,
1606 * so it can be re-added without a resync.
1607 * Pointless because if there are any spares to skip,
1608 * then a recovery will happen and soon that array won't
1609 * be degraded any more and the spare can go back to sleep then.
1610 */
1611 mddev->sb_dirty = 1;
1612
1600 sync_req = mddev->in_sync; 1613 sync_req = mddev->in_sync;
1601 mddev->utime = get_seconds(); 1614 mddev->utime = get_seconds();
1602 if (mddev->sb_dirty == 3) 1615 if (mddev->sb_dirty == 3)