linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: mwilck@arcor.de
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] RAID10: Allow skipping recovery when clean arrays are assembled
Date: Wed, 20 Mar 2013 10:46:57 +1100	[thread overview]
Message-ID: <20130320104657.3d3d6bf0@notabene.brown> (raw)
In-Reply-To: <1363718133-7180-1-git-send-email-mwilck@arcor.de>

[-- Attachment #1: Type: text/plain, Size: 1555 bytes --]

On Tue, 19 Mar 2013 19:35:33 +0100 mwilck@arcor.de wrote:

> 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).
> 
> Signed-off-by: Martin Wilck <mwilck@arcor.de>
> 
> ---
>  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) ||

applied, thanks.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2013-03-19 23:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 20:03 Strange / inconsistent behavior with mdadm -I -R Martin Wilck
2013-03-14 20:11 ` [PATCH] RAID10: Allow skipping recovery when clean arrays are assembled mwilck
2013-03-17 23:06   ` NeilBrown
2013-03-17 23:35 ` Strange / inconsistent behavior with mdadm -I -R NeilBrown
2013-03-19 18:29   ` Martin Wilck
2013-03-21  1:22     ` NeilBrown
2013-03-27  5:53       ` NeilBrown
2013-03-27 20:29         ` Martin Wilck
2013-04-16 19:09         ` Martin Wilck
2013-03-19 18:35   ` [PATCH] RAID10: Allow skipping recovery when clean arrays are assembled mwilck
2013-03-19 23:46     ` NeilBrown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130320104657.3d3d6bf0@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=mwilck@arcor.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).