linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
Cc: linux-raid@vger.kernel.org,
	Artur Paszkiewicz <artur.paszkiewicz@intel.com>,
	Pawel Baldysiak <pawel.baldysiak@intel.com>
Subject: Re: [PATCH 1/2] Grow: close file descriptor earlier to avoid "still in use" when stopping
Date: Thu, 24 Dec 2015 10:00:14 +1100	[thread overview]
Message-ID: <877fk422kh.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <1450871831-25452-1-git-send-email-artur.paszkiewicz@intel.com>

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

On Wed, Dec 23 2015, Artur Paszkiewicz wrote:

> Close fd2 as soon as it is no longer needed, before calling
> Grow_continue(). Otherwise, we won't be able to stop an array with
> external metadata during reshape, because mdadm running in background
> will be keeping it open.
>
> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
> ---
>  Grow.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/Grow.c b/Grow.c
> index 80d7b22..f65b36a 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -4873,6 +4873,9 @@ int Grow_continue_command(char *devname, int fd,
>  
>  		sysfs_init(content, fd2, mdstat->devnm);
>  
> +		close(fd2);
> +		fd2 = -1;
> +
>  		/* start mdmon in case it is not running
>  		 */
>  		if (!mdmon_running(container))

applied, thanks.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

      parent reply	other threads:[~2015-12-23 23:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23 11:57 [PATCH 1/2] Grow: close file descriptor earlier to avoid "still in use" when stopping Artur Paszkiewicz
2015-12-23 11:57 ` [PATCH 2/2] imsm: abort reshape if sync_action is not "reshape" Artur Paszkiewicz
2015-12-23 23:04   ` NeilBrown
2015-12-23 23:00 ` 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=877fk422kh.fsf@notabene.neil.brown.name \
    --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).