From: NeilBrown <neilb@suse.de>
To: Pawel Baldysiak <pawel.baldysiak@intel.com>
Cc: linux-raid@vger.kernel.org, artur.paszkiewicz@intel.com
Subject: Re: [PATCH] Grow: Do not try to restart if reshape is running
Date: Thu, 17 Jul 2014 14:11:01 +1000 [thread overview]
Message-ID: <20140717141101.7318564a@notabene.brown> (raw)
In-Reply-To: <20140716102034.18952.74271.stgit@gklab-154-222.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1909 bytes --]
On Wed, 16 Jul 2014 12:20:34 +0200 Pawel Baldysiak
<pawel.baldysiak@intel.com> wrote:
> Grow process did not check if reshape is already started
> when deciding about restarting.
> Sync_action should be checked in this case, and if
> reshape is running - restart flag should not be set.
> Otherwise, Grow process will fail to write data to
> sysfs, and reshape will not be continued.
>
> Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> ---
> Grow.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Grow.c b/Grow.c
> index a2f4f14..9ba7f76 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -2822,6 +2822,7 @@ static int reshape_array(char *container, int fd, char *devname,
> unsigned long long array_size;
> int done;
> struct mdinfo *sra = NULL;
> + char buf[20];
>
> /* when reshaping a RAID0, the component_size might be zero.
> * So try to fix that up.
> @@ -2869,7 +2870,9 @@ static int reshape_array(char *container, int fd, char *devname,
> goto release;
> }
>
> - if (st->ss->external && restart && (info->reshape_progress == 0)) {
> + if (st->ss->external && restart && (info->reshape_progress == 0) &&
> + !((sysfs_get_str(info, NULL, "sync_action", buf, sizeof(buf)) > 0) &&
> + (strncmp(buf, "reshape", 7) == 0))) {
> /* When reshape is restarted from '0', very begin of array
> * it is possible that for external metadata reshape and array
> * configuration doesn't happen.
>
> --
> 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
Applied, thanks.
Though I reindented it so that it was more obvious that the '!' applied tot
he 'strncmp' as well.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
prev parent reply other threads:[~2014-07-17 4:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-16 10:20 [PATCH] Grow: Do not try to restart if reshape is running Pawel Baldysiak
2014-07-17 4:11 ` 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=20140717141101.7318564a@notabene.brown \
--to=neilb@suse.de \
--cc=artur.paszkiewicz@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=pawel.baldysiak@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).