linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pawel Baldysiak <pawel.baldysiak@intel.com>
To: linux-raid@vger.kernel.org
Cc: jes.sorensen@redhat.com, artur.paszkiewicz@intel.com,
	Pawel Baldysiak <pawel.baldysiak@intel.com>
Subject: [PATCH 1/1] Grow: close fd earlier to avoid "cannot get excl access" when stopping
Date: Fri, 11 Mar 2016 13:49:07 +0100	[thread overview]
Message-ID: <1457700547-13253-1-git-send-email-pawel.baldysiak@intel.com> (raw)

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;
-- 
2.5.0


             reply	other threads:[~2016-03-11 12:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 12:49 Pawel Baldysiak [this message]
2016-03-11 17:31 ` [PATCH 1/1] Grow: close fd earlier to avoid "cannot get excl access" when stopping Jes Sorensen

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=1457700547-13253-1-git-send-email-pawel.baldysiak@intel.com \
    --to=pawel.baldysiak@intel.com \
    --cc=artur.paszkiewicz@intel.com \
    --cc=jes.sorensen@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    /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).