Re: [PATCH 03/14] FIX: Do not unblock array accidentally

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

 



On Fri, 16 Sep 2011 13:54:09 +0200 Adam Kwolek <adam.kwolek@xxxxxxxxx> wrote:

> When sysfs_set_array() function is called, it tests if array
> can be configured using sysfs. Setting metadata_version entry
> can accidentally unblock mdmon when array is under reshape.
> To avoid this, blocking character '-' is checked and if is is set,
> it is used for array test.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
> ---
> 
>  sysfs.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/sysfs.c b/sysfs.c
> index 2146264..903202d 100644
> --- a/sysfs.c
> +++ b/sysfs.c
> @@ -541,7 +541,17 @@ int sysfs_set_array(struct mdinfo *info, int vers)
>  	ver[0] = 0;
>  	if (info->array.major_version == -1 &&
>  	    info->array.minor_version == -2) {
> +		char buf[1024];
>  		strcat(strcpy(ver, "external:"), info->text_version);
> +		if (sysfs_get_str(info, NULL, "metadata_version",
> +						  buf, 1024) > 0) {
> +			/* Testing string should not affect
> +			 * monitor blocking functionality
> +			 * Set blocking character if present in sysfs already
> +			 */
> +			if (buf[9] == '-')
> +				ver[9] = '-';
> +		}
>  
>  		if ((vers % 100) < 2 ||
>  		    sysfs_set_str(info, NULL, "metadata_version",
> 
> --
> 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

I have applied this patch, though I rewrote the comment a bit.

thanks,
NeilBrown

Attachment: signature.asc
Description: PGP signature


[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