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 8 of 8] MD:  raid5 do not set fullsync
Date: Wed, 8 Jun 2011 15:20:00 +1000	[thread overview]
Message-ID: <20110608152000.564d2bcc@notabene.brown> (raw)
In-Reply-To: <1307487163.31279.18.camel@f14.redhat.com>

On Tue, 07 Jun 2011 17:52:43 -0500 Jonathan Brassow <jbrassow@redhat.com>
wrote:

> Add new flag for struct mdk_rdev_s to indicate when recovery can use bitmap
> 
> Device-mapper can tell if a device is in-sync, in need of partial (bitmap aided)
> recovery, or in need of complete recovery.  The raid5 code assumes that if a
> device is not in-sync, then it must undergo complete recovery - it does not
> honor the bitmap.  The flag 'RecoverByBitmap' has been introduced to force raid5
> not to set 'conf->fullsync' if the superblock routines have already determined
> that only a partial recovery is necessary.
> 
> RFC-by: Jonathan Brassow <jbrassow@redhat.com>
> 
> Index: linux-2.6/drivers/md/raid5.c
> ===================================================================
> --- linux-2.6.orig/drivers/md/raid5.c
> +++ linux-2.6/drivers/md/raid5.c
> @@ -4858,7 +4858,7 @@ static raid5_conf_t *setup_conf(mddev_t 
>  			printk(KERN_INFO "md/raid:%s: device %s operational as raid"
>  			       " disk %d\n",
>  			       mdname(mddev), bdevname(rdev->bdev, b), raid_disk);
> -		} else
> +		} else if (!test_bit(RecoverByBitmap, &rdev->flags))
>  			/* Cannot rely on bitmap to complete recovery */
>  			conf->fullsync = 1;

I think we can just do
                } else if (rdev->saved_raid_disk != raid_disk)

and not add an extra flag.
This is more in keeping with e.g. raid5_add_disk.

Thanks,

NeilBrown


>  	}
> Index: linux-2.6/drivers/md/md.h
> ===================================================================
> --- linux-2.6.orig/drivers/md/md.h
> +++ linux-2.6/drivers/md/md.h
> @@ -77,6 +77,8 @@ struct mdk_rdev_s
>  #define Blocked		8		/* An error occurred on an externally
>  					 * managed array, don't allow writes
>  					 * until it is cleared */
> +#define RecoverByBitmap 9               /* Used by device-mapper to ensure this
> +					 * device is recovered by the bitmap. */
>  	wait_queue_head_t blocked_wait;
>  
>  	int desc_nr;			/* descriptor index in the superblock */
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


      reply	other threads:[~2011-06-08  5:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07 22:52 [PATCH 8 of 8] MD: raid5 do not set fullsync Jonathan Brassow
2011-06-08  5:20 ` 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=20110608152000.564d2bcc@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).