linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] FIX: chunk_size cannot be read by mdstat
@ 2010-11-29  9:56 Adam Kwolek
  2010-11-29 14:26 ` Kwolek, Adam
  2010-11-30  0:22 ` Neil Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Adam Kwolek @ 2010-11-29  9:56 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski

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@intel.com>
---

 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)


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

end of thread, other threads:[~2010-11-30  7:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-29  9:56 [PATCH] FIX: chunk_size cannot be read by mdstat Adam Kwolek
2010-11-29 14:26 ` Kwolek, Adam
2010-11-30  0:22 ` Neil Brown
2010-11-30  7:28   ` Kwolek, Adam
2010-11-30  7:36     ` 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).