RE: [PATCH] FIX: chunk_size cannot be read by mdstat

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

 



I've found that condition on strlen() doesn't always work (I wanted to achieve the same code style ;)),
so check for "check" string has to be used instead.

BR
Adam


> -----Original Message-----
> From: linux-raid-owner@xxxxxxxxxxxxxxx [mailto:linux-raid-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Adam Kwolek
> Sent: Monday, November 29, 2010 10:57 AM
> To: neilb@xxxxxxx
> Cc: linux-raid@xxxxxxxxxxxxxxx; Williams, Dan J; Ciechanowski, Ed
> Subject: [PATCH] FIX: chunk_size cannot be read by mdstat
> 
> Chunk size is not read by mdstat due to too week checking of 'check'
> string in mdstat.
> It is the same result for 'check' and 'chunk_size' check.
> 
> Add  string length additional condition for checking.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
> ---
> 
>  mdstat.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/mdstat.c b/mdstat.c
> index bb030bf..5f69e31 100644
> --- a/mdstat.c
> +++ b/mdstat.c
> @@ -248,7 +248,8 @@ struct mdstat_ent *mdstat_read(int hold, int start)
>  				else
>  					ent->resync = 0;
>  			} else if (ent->percent == -1 &&
> -				   (w[0] == 'r' || w[0] == 'c')) {
> +				   (w[0] == 'r' ||
> +				    ((w[0] == 'c') && strlen(w) < 9))) {
>  				if (strncmp(w, "resync", 4)==0)
>  					ent->resync = 1;
>  				if (strncmp(w, "reshape", 7)==0)
> 
> --
> 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
ÿô.nlj·Ÿ®‰­†+%ŠË±é¥Šwÿº{.nlj·¥Š{±þ¶¢wø¡Ü}©ž²ÆzÚj:+v‰¨þø®w¥þŠàÞ¨è&¢)ß«a¶Úÿûz¹ÞúŽŠÝjÿŠwèf



[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