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
Subject: Re: [PATCH 08/14] Check if reshape can be restarted
Date: Wed, 21 Sep 2011 12:27:34 +1000 [thread overview]
Message-ID: <20110921122734.338d6f59@notabene.brown> (raw)
In-Reply-To: <20110916115448.5201.56575.stgit@gklab-128-013.igk.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2153 bytes --]
On Fri, 16 Sep 2011 13:54:48 +0200 Adam Kwolek <adam.kwolek@intel.com> wrote:
> When reshape was invoked during initramfs start-up stage
> array is pushed in to reshape state already, so read only
> state cannot be set again. To verify if reshape continuation should
> be allowed sync_action sysfs key is tested and number of existing mdadm
> instances is checked again.
>
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Again, it is not at all clear to me what you are trying to protect against
here...
The "set_str ... readonly" is going to need to be changed.
In the normal case, this is where the array is activated, but it is activated
read-only to ensure no reshape automatically starts.
In the --continue case it is already running and reshape is suspended, so
there is no need to set it to readonly when Grow_continue is called from
Grow_continue_command.
NeilBrown
> ---
>
> Grow.c | 19 +++++++++++++++++--
> 1 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/Grow.c b/Grow.c
> index 4d2c361..b331287 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -3714,8 +3714,23 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
> int err;
>
> err = sysfs_set_str(info, NULL, "array_state", "readonly");
> - if (err)
> - return err;
> + if (err) {
> + /* check if array is set in to reshape stare,
> + * and current mdadm instance is the only one
> + */
> + if ((sysfs_get_str(info, NULL, "sync_action",
> + buf, 40) == 8) &&
> + (count_mdadms() == 1)) {
> + dprintf("Warning: Grow_continue() cannot set array in"
> + "to read only state [sync_action is %s].",
> + buf);
> + if (strncmp(buf, "reshape", 7))
> + return err;
> + dprintf("Allow to continue.\n");
> + } else
> + return err;
> + }
> +
> if (st->ss->external) {
> fmt_devname(buf, st->container_dev);
> container = buf;
>
> --
> 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: 190 bytes --]
next prev parent reply other threads:[~2011-09-21 2:27 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-16 11:53 [PATCH 00/14] Series short description Adam Kwolek
2011-09-16 11:53 ` [PATCH 01/14] Stop array reshape when mounted initramfs is detected Adam Kwolek
2011-09-19 10:42 ` NeilBrown
2011-09-19 11:14 ` Kwolek, Adam
2011-09-16 11:54 ` [PATCH 02/14] Stop container reshape while using initramfs Adam Kwolek
2011-09-16 11:54 ` [PATCH 03/14] FIX: Do not unblock array accidentally Adam Kwolek
2011-09-21 2:19 ` NeilBrown
2011-09-16 11:54 ` [PATCH 04/14] Add continue option to grow command Adam Kwolek
2011-09-21 2:22 ` NeilBrown
2011-09-21 7:47 ` Kwolek, Adam
2011-09-16 11:54 ` [PATCH 05/14] Add Grow_continue_command Adam Kwolek
2011-09-16 11:54 ` [PATCH 06/14] Check and run mdmon Adam Kwolek
2011-09-16 11:54 ` [PATCH 07/14] FIX: Memory leak during Assembly Adam Kwolek
2011-09-21 2:23 ` NeilBrown
2011-09-16 11:54 ` [PATCH 08/14] Check if reshape can be restarted Adam Kwolek
2011-09-21 2:27 ` NeilBrown [this message]
2011-09-21 7:45 ` Kwolek, Adam
2011-09-16 11:54 ` [PATCH 09/14] Move restore backup code to function Adam Kwolek
2011-09-21 2:28 ` NeilBrown
2011-09-16 11:55 ` [PATCH 10/14] Perform restore backup for reshape continuation Adam Kwolek
2011-09-21 2:29 ` NeilBrown
2011-09-21 7:35 ` Kwolek, Adam
2011-09-16 11:55 ` [PATCH 11/14] Add possibility to restart reshape for native metadata Adam Kwolek
2011-09-16 11:55 ` [PATCH 12/14] Early reshape backup verification Adam Kwolek
2011-09-21 2:31 ` NeilBrown
2011-09-21 7:33 ` Kwolek, Adam
2011-09-16 11:55 ` [PATCH 13/14] Check if md allows to control reshape Adam Kwolek
2011-09-21 2:33 ` NeilBrown
2011-09-21 7:31 ` Kwolek, Adam
2011-09-21 7:51 ` NeilBrown
2011-09-16 11:55 ` [PATCH 14/14] Manual update for --continue option Adam Kwolek
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=20110921122734.338d6f59@notabene.brown \
--to=neilb@suse.de \
--cc=adam.kwolek@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).