linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <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, wojciech.neubauer@intel.com
Subject: Re: [PATCH 6/9] FIX: Cannot continue reshape if mdmon is not run
Date: Thu, 10 Mar 2011 11:37:39 +1100	[thread overview]
Message-ID: <20110310113739.4643a5c4@notabene.brown> (raw)
In-Reply-To: <20110309134618.8939.46747.stgit@gklab-128-013.igk.intel.com>

On Wed, 09 Mar 2011 14:46:18 +0100 Adam Kwolek <adam.kwolek@intel.com> wrote:

> Grow_continue() call was moved down in assemble_container_content()
> because it needs running mdmon. Mdmon is running at the end of this function.
> 
> Due to mdmon is required to run setting array_state was disabled for reshaped array.
> This causes that md will keep stable reshape in sync_action.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
> ---
> 
>  Assemble.c |   23 ++++++++++++++---------
>  1 files changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/Assemble.c b/Assemble.c
> index 0ffbbc9..3771ee1 100644
> --- a/Assemble.c
> +++ b/Assemble.c
> @@ -1544,7 +1544,7 @@ int assemble_container_content(struct supertype *st, int mdfd,
>  	if (runstop > 0 ||
>  		 (working + preexist + expansion) >=
>  			content->array.working_disks) {
> -		int err;
> +		int err = 0;
>  
>  		if (content->reshape_active) {
>  			int spare = content->array.raid_disks + expansion;
> @@ -1577,18 +1577,19 @@ int assemble_container_content(struct supertype *st, int mdfd,
>  						" to specify a --backup-file\n");
>  				return 1;
>  			}
> -
> -			err = Grow_continue(mdfd, st, content, backup_file);
> -		} else switch(content->array.level) {
> +		}
> +		switch (content->array.level) {
>  		case LEVEL_LINEAR:
>  		case LEVEL_MULTIPATH:
>  		case 0:
> -			err = sysfs_set_str(content, NULL, "array_state",
> -					    "active");
> +			if (!content->reshape_active)
> +				err = sysfs_set_str(content, NULL,
> +						    "array_state", "active");
>  			break;
>  		default:
> -			err = sysfs_set_str(content, NULL, "array_state",
> -				      "readonly");
> +			if (!content->reshape_active)
> +				err = sysfs_set_str(content, NULL,
> +						    "array_state", "readonly");
>  			/* start mdmon if needed. */
>  			if (!err) {
>  				if (!mdmon_running(st->container_dev))
> @@ -1615,8 +1616,12 @@ int assemble_container_content(struct supertype *st, int mdfd,
>  					expansion);
>  			fprintf(stderr, "\n");
>  		}
> -		if (!err)
> +		if (!err) {
>  			wait_for(chosen_name, mdfd);
> +			if (content->reshape_active)
> +				err = Grow_continue(mdfd, st, content,
> +						    backup_file);
> +		}
>  		return err;
>  		/* FIXME should have an O_EXCL and wait for read-auto */
>  	} else {
> 

This is needlessly complex.

I have applied the following instead.

Thanks,
NeilBrown

commit f362d22b5bc492c60fa1ea7e0f8346b7837dd7da
Author: NeilBrown <neilb@suse.de>
Date:   Thu Mar 10 11:36:47 2011 +1100

    Grow: make sure mdmon is running for Grow_continue arrays.
    
    when starting an array that is in the middle of a migration,
    we need to start mdmon, just as we do for arrays which are not
    in the middle of a migration.
    
    Repored-by: Adam Kwolek <adam.kwolek@intel.com>
    Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/Grow.c b/Grow.c
index 5acd94d..734fa6d 100644
--- a/Grow.c
+++ b/Grow.c
@@ -3371,6 +3371,11 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
                container = buf;
                freeze(st);
 
+               if (!mdmon_running(st->container_dev))
+                       start_mdmon(st->container_dev);
+               ping_monitor(devnum2devname(st->container_dev));
+
+
                if (info->reshape_active == 2) {
                        int cfd = open_dev(st->container_dev);
                        if (cfd < 0)



  reply	other threads:[~2011-03-10  0:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-09 13:45 [PATCH 0/9] Reshape restart from checkpoint Adam Kwolek
2011-03-09 13:45 ` [PATCH 1/9] FIX: Load container content for container reshape continuation Adam Kwolek
2011-03-10  0:27   ` NeilBrown
2011-03-09 13:45 ` [PATCH 2/9] FIX: Block reshaped array monitoring Adam Kwolek
2011-03-10  0:28   ` NeilBrown
2011-03-09 13:45 ` [PATCH 3/9] FIX: Make expansion counter usable Adam Kwolek
2011-03-10  0:28   ` NeilBrown
2011-03-09 13:46 ` [PATCH 4/9] imsm: FIX: Do not clean checkpoint for active reshape Adam Kwolek
2011-03-10  0:33   ` NeilBrown
2011-03-09 13:46 ` [PATCH 5/9] FIX: Unfreeze array on success only during reshape continuation Adam Kwolek
2011-03-10  0:36   ` NeilBrown
2011-03-09 13:46 ` [PATCH 6/9] FIX: Cannot continue reshape if mdmon is not run Adam Kwolek
2011-03-10  0:37   ` NeilBrown [this message]
2011-03-09 13:46 ` [PATCH 7/9] FIX: Array cannot be opened for writing on restart Adam Kwolek
2011-03-10  0:38   ` NeilBrown
2011-03-09 13:46 ` [PATCH 8/9] FIX: Set 'active' array state before array configuration Adam Kwolek
2011-03-10  0:39   ` NeilBrown
2011-03-09 13:46 ` [PATCH 9/9] imsm : FIX: Assemble dirty array when reshape is in progress Adam Kwolek
2011-03-10  0:39   ` NeilBrown

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=20110310113739.4643a5c4@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 \
    --cc=wojciech.neubauer@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).