linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Jonathan Brassow <jbrassow@redhat.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH - v2] DM RAID: Fix for ineffective "sync" directive
Date: Thu, 20 Sep 2012 12:35:25 +1000	[thread overview]
Message-ID: <20120920123525.282c04da@notabene.brown> (raw)
In-Reply-To: <1347648483.27926.8.camel@f16>

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

On Fri, 14 Sep 2012 13:48:03 -0500 Jonathan Brassow <jbrassow@redhat.com>
wrote:

> Neil,
> 
> I've taken your suggestion to not muck around with the BITMAP_STALE, and
> instead simply clear the superblocks as a whole when the "sync"
> directive is given.
> 
>  brassow
> 
> DM RAID: Fix for "sync" directive ineffectiveness
> 
> There are two table arguments that can be given to a DM RAID target that
> control whether the array is forced to (re)synchronize or skip initialization:
> "sync" and "nosync".  When "sync" is given, we set mddev->recovery_cp to 0
> in order to cause the device to resynchronize.  This is insufficient if there
> is a bitmap in use, because the array will simply look at the bitmap and see
> that there is no recovery necessary.
> 
> The fix is to skip over the loading of the superblocks when "sync" is given,
> causing new superblocks to be written that will force the array to go through
> initialization (i.e. synchronization).
> 
> Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
> 
> Index: linux-upstream/drivers/md/dm-raid.c
> ===================================================================
> --- linux-upstream.orig/drivers/md/dm-raid.c
> +++ linux-upstream/drivers/md/dm-raid.c
> @@ -960,6 +960,19 @@ static int analyse_superblocks(struct dm
>  
>  	freshest = NULL;
>  	rdev_for_each_safe(rdev, tmp, mddev) {
> +		/*
> +		 * Skipping super_load due to DMPF_SYNC will cause
> +		 * the array to undergo initialization again as
> +		 * though it were new.  This is the intended effect
> +		 * of the "sync" directive.
> +		 *
> +		 * When reshaping capability is added, we must ensure
> +		 * that the "sync" directive is disallowed during the
> +		 * reshape.
> +		 */
> +		if (rs->print_flags & DMPF_SYNC)
> +			continue;
> +
>  		if (!rdev->meta_bdev)
>  			continue;
>  
> 

OK, applied.

Thanks.
NeilBrown

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

      reply	other threads:[~2012-09-20  2:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23 15:31 [PATCH] DM RAID: Fix for ineffective "sync" directive Jonathan Brassow
2012-09-05  1:44 ` NeilBrown
2012-09-05 14:32   ` Brassow Jonathan
2012-09-10  7:11     ` NeilBrown
2012-09-14 18:48 ` [PATCH - v2] " Jonathan Brassow
2012-09-20  2:35   ` 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=20120920123525.282c04da@notabene.brown \
    --to=neilb@suse.de \
    --cc=jbrassow@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    /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).