linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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, wojciech.neubauer@intel.com
Subject: Re: [PATCH 4/4] WORKAROUND: mdadm hangs during reshape
Date: Thu, 27 Jan 2011 13:05:06 +1000	[thread overview]
Message-ID: <20110127130506.7813b19d@nbeee.brown> (raw)
In-Reply-To: <20110120105746.22926.74908.stgit@gklab-128-013.igk.intel.com>

On Thu, 20 Jan 2011 11:57:46 +0100
Adam Kwolek <adam.kwolek@intel.com> wrote:

> During reshape when reshape is finished in md, progress_reshape()
> hangs on select(). Timeout is introduced to allow for reshape
> conditions check.
> 
> You point in the email that you do not like this solution.
> It is put in to series as reminder.

Thanks for the reminder.  
I figured out what is really happening and wrote a better work-around.
You can find it in the git history - fully commented.

Thanks,
NeilBrown

> 
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
> ---
> 
>  Grow.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/Grow.c b/Grow.c
> index 717d087..c9f4b9c 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -2394,6 +2394,7 @@ int progress_reshape(struct mdinfo *info,
> struct reshape *reshape,
>  		 * waiting forever on a dead array
>  		 */
>  		char action[20];
> +		struct timeval timeout;
>  		fd_set rfds;
>  		if (sysfs_get_str(info, NULL, "sync_action",
>  				  action, 20) <= 0 ||
> @@ -2401,7 +2402,9 @@ int progress_reshape(struct mdinfo *info,
> struct reshape *reshape, break;
>  		FD_ZERO(&rfds);
>  		FD_SET(fd, &rfds);
> -		select(fd+1, NULL, NULL, &rfds, NULL);
> +		timeout.tv_sec = 1;
> +		timeout.tv_usec = 0;
> +		select(fd+1, NULL, NULL, &rfds, &timeout);
>  		if (sysfs_fd_get_ll(fd, &completed) < 0) {
>  			close(fd);
>  			goto check_progress;


      reply	other threads:[~2011-01-27  3:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 10:57 [PATCH 0/4] OLCE continue reshape for all arrays in container (rebased) Adam Kwolek
2011-01-20 10:57 ` [PATCH 1/4] imsm: Update metadata for second array Adam Kwolek
2011-01-26  5:33   ` Neil Brown
2011-01-20 10:57 ` [PATCH 2/4] imsm: FIX: spare cannot be added Adam Kwolek
2011-01-27  3:02   ` Neil Brown
2011-01-27  7:59     ` Kwolek, Adam
2011-01-20 10:57 ` [PATCH 3/4] FIX: monitor doesn't handshake with md Adam Kwolek
2011-01-27  3:03   ` Neil Brown
2011-01-27  7:57     ` Kwolek, Adam
2011-01-20 10:57 ` [PATCH 4/4] WORKAROUND: mdadm hangs during reshape Adam Kwolek
2011-01-27  3:05   ` Neil Brown [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=20110127130506.7813b19d@nbeee.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).