Re: [PATCH] MD: Allow restarting an interrupted incremental recovery.
From: Andrei Warkentin <hidden>
Date: 2011-10-18 17:07:24
Hi Neil, ----- Original Message -----
From: "NeilBrown" <redacted> To: "Andrei Warkentin" <redacted> Cc: linux-raid@vger.kernel.org Sent: Monday, October 17, 2011 9:22:39 PM Subject: Re: [PATCH] MD: Allow restarting an interrupted incremental recovery. On Mon, 17 Oct 2011 19:22:11 -0400 Andrei Warkentin [off-list ref] wrote:quoted
If an incremental recovery was interrupted, a subsequent re-add will result in a full recovery, even though an incremental should be possible (seen with raid1). Solve this problem by not updating the superblock on the recovering device until array is not degraded any longer. Cc: Neil Brown <redacted> Signed-off-by: Andrei Warkentin <redacted> ---
Thanks. I've applied this and pushed it to my for-next branch. My current HEAD use pr_debug instead of dprintk so I fixed that. Also I realised that clearing saved_raid_disk when an array is not degraded is no longer enough. We also need to clear it when the device becomes In_sync. Consider a 3-drive RAID1 with two drives missing. You add back one of them and when it is recovered it needs saved_raid_disk cleared so that the superblock gets written out. So below is what I applied.
Wouldn't all drives being In_sync imply the array is not degraded - i.e. can the check for a degraded array be omitted then, at all? I.e. if after the resync the In_sync bit is set - drop saved_raid_role. A