linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] imsm: FIX: imsm_add_spare() wrongly tests spares list
@ 2010-12-15  9:38 Adam Kwolek
  2010-12-15 22:08 ` Neil Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Kwolek @ 2010-12-15  9:38 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

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.

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 */


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] imsm: FIX: imsm_add_spare() wrongly tests spares list
  2010-12-15  9:38 [PATCH] imsm: FIX: imsm_add_spare() wrongly tests spares list Adam Kwolek
@ 2010-12-15 22:08 ` Neil Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2010-12-15 22:08 UTC (permalink / raw)
  To: Adam Kwolek
  Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

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 */


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-15 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).