From: Neil Brown <neilb@suse.de>
To: Adam Kwolek <adam.kwolek@intel.com>
Cc: linux-raid@vger.kernel.org, dan.j.williams@intel.com,
ed.ciechanowski@intel.com
Subject: Re: [PATCH] FIX: chunk_size cannot be read by mdstat
Date: Tue, 30 Nov 2010 11:22:11 +1100 [thread overview]
Message-ID: <20101130112211.700f5940@notabene.brown> (raw)
In-Reply-To: <20101129095650.12551.98023.stgit@gklab-170-024.igk.intel.com>
On Mon, 29 Nov 2010 10:56:50 +0100 Adam Kwolek <adam.kwolek@intel.com> wrote:
> 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.
Actually chunk size is not read because there is no code to try to read it.
The chunk size needs to be reported by the personality, and they are
inconsistent in the way they report it so it is much easier to just ignore it.
GET_ARRAY_INFO gets the chunk size easily, so we stick with that when chunk
size is needed.
Thanks,
NeilBrown
>
> 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)
next prev parent reply other threads:[~2010-11-30 0:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2010-11-30 7:28 ` Kwolek, Adam
2010-11-30 7:36 ` Neil Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101130112211.700f5940@notabene.brown \
--to=neilb@suse.de \
--cc=adam.kwolek@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ed.ciechanowski@intel.com \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).