From: NeilBrown <neilb@suse.de>
To: Adam Kwolek <adam.kwolek@intel.com>
Cc: linux-raid@vger.kernel.org, ed.ciechanowski@intel.com,
marcin.labun@intel.com, dan.j.williams@intel.com,
anna.czarnowska@intel.com
Subject: Re: [PATCH] FIX: Changes in '0' case for reshape position verification
Date: Mon, 20 Feb 2012 14:14:00 +1100 [thread overview]
Message-ID: <20120220141400.4f8bbf7f@notabene.brown> (raw)
In-Reply-To: <20120216131604.4985.58287.stgit@gklab-128-013.igk.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2129 bytes --]
On Thu, 16 Feb 2012 14:16:04 +0100 Adam Kwolek <adam.kwolek@intel.com> wrote:
> Reading sysfs entry that is '0' long should cause an error.
> Reshape position cannot be empty.
>
> Absence of reshape position should be ignored. It is possible
> that we are about raid0 reshape continuation and it is before takeover.
> This means that according metadata (changed by mdmon) it should be reshaped
> but md knows nothing about it at this moment. Reshape continuation
> in reshape_array() will change it to raid4 and reshape position appears
> in sysfs.
>
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Thanks. Applied.
NeilBrown
> ---
>
> Grow.c | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/Grow.c b/Grow.c
> index 53a7cad..239b50d 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -1876,9 +1876,12 @@ static int verify_reshape_position(struct mdinfo *info, int level)
> {
> int ret_val = 0;
> char buf[40];
> + int rv;
>
> /* read sync_max, failure can mean raid0 array */
> - if (sysfs_get_str(info, NULL, "sync_max", buf, 40) > 0) {
> + rv = sysfs_get_str(info, NULL, "sync_max", buf, 40);
> +
> + if (rv > 0) {
> char *ep;
> unsigned long long position = strtoull(buf, &ep, 0);
>
> @@ -1906,6 +1909,11 @@ static int verify_reshape_position(struct mdinfo *info, int level)
> ret_val = 1;
> }
> }
> + } else if (rv == 0) {
> + /* for valid sysfs entry, 0-length content
> + * should be indicated as error
> + */
> + ret_val = -1;
> }
>
> return ret_val;
> @@ -3975,7 +3983,7 @@ int Grow_continue_command(char *devname, int fd,
> * correct position
> */
> if (verify_reshape_position(content,
> - map_name(pers, mdstat->level)) <= 0) {
> + map_name(pers, mdstat->level)) < 0) {
> ret_val = 1;
> goto Grow_continue_command_exit;
> }
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
prev parent reply other threads:[~2012-02-20 3:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 13:16 [PATCH] FIX: Changes in '0' case for reshape position verification Adam Kwolek
2012-02-20 3:14 ` NeilBrown [this message]
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=20120220141400.4f8bbf7f@notabene.brown \
--to=neilb@suse.de \
--cc=adam.kwolek@intel.com \
--cc=anna.czarnowska@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ed.ciechanowski@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=marcin.labun@intel.com \
/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).