linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Adam Kwolek <adam.kwolek@intel.com>
Cc: linux-raid@vger.kernel.org, dan.j.williams@intel.com,
	ed.ciechanowski@intel.com, wojciech.neubauer@intel.com
Subject: Re: [PATCH] imsm: FIX: imsm_add_spare() wrongly tests spares list
Date: Thu, 16 Dec 2010 09:08:17 +1100	[thread overview]
Message-ID: <20101216090817.79d6ad30@notabene.brown> (raw)
In-Reply-To: <20101215093814.9746.43002.stgit@gklab-170-024.igk.intel.com>

On Wed, 15 Dec 2010 10:38:15 +0100 Adam Kwolek <adam.kwolek@intel.com> wrote:

> For more than one disk tested additional_test_list was searched from last
> point, not from begin.
> 
> This bug causes that more than 2 disks cannot be added to imsm array,
> when imsm_add_spare() is used for this.

Thanks.  Patch applied.

NeilBrown


> 
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
> ---
> 
>  super-intel.c |   12 +++++++-----
>  1 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/super-intel.c b/super-intel.c
> index e32228e..4758951 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -5454,6 +5454,7 @@ static struct dl *imsm_add_spare(struct intel_super *super, int slot,
>  	__u32 array_start = 0;
>  	__u32 array_end = 0;
>  	struct dl *dl;
> +	struct mdinfo *test_list;
>  
>  	for (dl = super->disks; dl; dl = dl->next) {
>  		/* If in this array, skip */
> @@ -5467,16 +5468,17 @@ static struct dl *imsm_add_spare(struct intel_super *super, int slot,
>  			}
>  		if (d)
>  			continue;
> -		while (additional_test_list) {
> -			if (additional_test_list->disk.major == dl->major &&
> -			    additional_test_list->disk.minor == dl->minor) {
> +		test_list = additional_test_list;
> +		while (test_list) {
> +			if (test_list->disk.major == dl->major &&
> +			    test_list->disk.minor == dl->minor) {
>  				dprintf("%x:%x already in additional test list\n",
>  					dl->major, dl->minor);
>  				break;
>  			}
> -			additional_test_list = additional_test_list->next;
> +			test_list = test_list->next;
>  		}
> -		if (additional_test_list)
> +		if (test_list)
>  			continue;
>  
>  		/* skip in use or failed drives */


      reply	other threads:[~2010-12-15 22:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15  9:38 [PATCH] imsm: FIX: imsm_add_spare() wrongly tests spares list Adam Kwolek
2010-12-15 22:08 ` Neil Brown [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=20101216090817.79d6ad30@notabene.brown \
    --to=neilb@suse.de \
    --cc=adam.kwolek@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ed.ciechanowski@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=wojciech.neubauer@intel.com \
    /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).