From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Pawel Baldysiak <pawel.baldysiak@intel.com>
Cc: linux-raid@vger.kernel.org, artur.paszkiewicz@intel.com
Subject: Re: [PATCH 1/1] Grow: close fd earlier to avoid "cannot get excl access" when stopping
Date: Fri, 11 Mar 2016 12:31:51 -0500 [thread overview]
Message-ID: <wrfjr3fg7wfs.fsf@redhat.com> (raw)
In-Reply-To: <1457700547-13253-1-git-send-email-pawel.baldysiak@intel.com> (Pawel Baldysiak's message of "Fri, 11 Mar 2016 13:49:07 +0100")
Pawel Baldysiak <pawel.baldysiak@intel.com> writes:
> If this file descriptor is not closed here, it remains open during
> reshape process and stopping process will end up with
> "cannot get exclusive access to container".
> Once this file descriptor is no longer needed - it can be closed.
>
> Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
> ---
> Grow.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Grow.c b/Grow.c
> index cf2750a..d9db00b 100755
> --- a/Grow.c
> +++ b/Grow.c
> @@ -2070,6 +2070,10 @@ size_change_error:
> * number of devices (On-Line Capacity Expansion) must be
> * performed at the level of the container
> */
> + if (fd > 0) {
> + close(fd);
> + fd = -1;
> + }
> rv = reshape_container(container, devname, -1, st, &info,
> c->force, c->backup_file, c->verbose, 0, 0, 0);
> frozen = 0;
I went in and looked at this one to see how we deal with the open file
descriptior. I was worried something else could try and access or close
it later, but it looks like we just let it dangle and rely on exit()
cleaning up. So I'll apply this one as is and hopefully someone will
feel excited enough about it to clean it up down the line ;)
Cheers,
Jes
prev parent reply other threads:[~2016-03-11 17:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 12:49 [PATCH 1/1] Grow: close fd earlier to avoid "cannot get excl access" when stopping Pawel Baldysiak
2016-03-11 17:31 ` Jes Sorensen [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=wrfjr3fg7wfs.fsf@redhat.com \
--to=jes.sorensen@redhat.com \
--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).