diff --git a/[refs] b/[refs] index eb76f3d5502d..388300a3e007 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 45f17e0c2ae05c133a348452690de0e5fa863293 +refs/heads/master: 84692195969b83f0ba57dc33ecf73e6c124dd186 diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c index b6d16022a53e..8dbab2ef3885 100644 --- a/trunk/drivers/md/md.c +++ b/trunk/drivers/md/md.c @@ -1597,6 +1597,19 @@ void md_update_sb(mddev_t * mddev) repeat: spin_lock_irq(&mddev->write_lock); + + if (mddev->degraded && mddev->sb_dirty == 3) + /* If the array is degraded, then skipping spares is both + * dangerous and fairly pointless. + * Dangerous because a device that was removed from the array + * might have a event_count that still looks up-to-date, + * so it can be re-added without a resync. + * Pointless because if there are any spares to skip, + * then a recovery will happen and soon that array won't + * be degraded any more and the spare can go back to sleep then. + */ + mddev->sb_dirty = 1; + sync_req = mddev->in_sync; mddev->utime = get_seconds(); if (mddev->sb_dirty == 3)