Re: [PATCH] RAID10: Allow skipping recovery when clean arrays are assembled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 14 Mar 2013 21:11:31 +0100 mwilck@xxxxxxxx wrote:

> From: Martin Wilck <mwilck@xxxxxxxx>
> 
> When an array is assembled incrementally with mdadm -I -R
> and the array switches to "active" mode, md starts a recovery.
> 
> If the array was clean, the "fullsync" flag will be 0. Skip
> the full recovery in this case, as RAID1 does (the code was
> actually copied from the sync_request() method of RAID1).
> ---
>  drivers/md/raid10.c |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 64d4824..e373d88 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -2863,6 +2863,22 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
>  		if (init_resync(conf))
>  			return 0;
>  
> +	/*
> +	 * Allow skipping a full rebuild for incremental assembly
> +	 * of a clean array, like RAID1 does.
> +	 */
> +	if (mddev->bitmap == NULL &&
> +	    mddev->recovery_cp == MaxSector &&
> +	    !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
> +	    conf->fullsync == 0) {
> +		*skipped = 1;
> +		max_sector = mddev->dev_sectors;
> +		if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ||
> +		    test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
> +			max_sector = mddev->resync_max_sectors;
> +		return max_sector - sector_nr;
> +	}
> +
>   skipped:
>  	max_sector = mddev->dev_sectors;
>  	if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ||


Thanks Martin - looks good.

However protocol requires that you add the magic string "Signed-off-by: your
email address" to the patch.  This affirms that you have the right (from a
copyright perspective) to contribute that patch - not that I doubt it, but it
is always good to have it in writing.
See section 12 of "Documentation/SubmittingPatches".

If you could just send me that line (you don't need to send the whole patch
as well), I'll apply the patch.

Thanks,
NeilBrown

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux