Re: [PATCH 3/9] FIX: Make expansion counter usable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 09 Mar 2011 14:45:54 +0100 Adam Kwolek <adam.kwolek@xxxxxxxxx> wrote:

> Currently whole array geometry is set in sysfs_set_array(),
> so none of disks (even for expansion) should fail during sysfs_add_disk()
> Due to this expansion counter should be used for reshaped array when
> disk slot is bigger than number of disks in array.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
> ---
> 
>  Assemble.c |   13 +++++++------
>  1 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/Assemble.c b/Assemble.c
> index fe917b2..0ffbbc9 100644
> --- a/Assemble.c
> +++ b/Assemble.c
> @@ -1526,13 +1526,14 @@ int assemble_container_content(struct supertype *st, int mdfd,
>  		sysfs_free(sra);
>  
>  	for (dev = content->devs; dev; dev = dev->next)
> -		if (sysfs_add_disk(content, dev, 1) == 0)
> -			working++;
> -		else if (errno == EEXIST)
> +		if (sysfs_add_disk(content, dev, 1) == 0) {
> +			if (dev->disk.raid_disk >= content->array.raid_disks &&
> +			    content->reshape_active)
> +				expansion++;
> +			else
> +				working++;
> +		} else if (errno == EEXIST)
>  			preexist++;
> -		else if (dev->disk.raid_disk >= content->array.raid_disks &&
> -			  content->reshape_active)
> -			expansion++;
>  	if (working == 0)
>  		return 1;/* Nothing new, don't try to start */
>  
> 

Applied, thanks.

NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux