All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH 1/7] ndctl, create-namespace: report failures due to namespace being mounted
Date: Mon, 25 Apr 2016 12:49:54 -0700	[thread overview]
Message-ID: <146161379487.21779.8389169524298318569.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <146161378966.21779.1219526957524644729.stgit@dwillia2-desk3.amr.corp.intel.com>

In the case when a filesystem is mounted on a namespace targeted for
reconfiguration or destruction, emit a message so the user knows to
unmount the filesystem, or otherwise communicate why ndctl could not
exclusively open the device for writing.

Reported-by: Linda Knippers <linda.knippers@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 builtin-xaction-namespace.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/builtin-xaction-namespace.c b/builtin-xaction-namespace.c
index 1f25cc18f5a2..97bb36525d7c 100644
--- a/builtin-xaction-namespace.c
+++ b/builtin-xaction-namespace.c
@@ -553,7 +553,9 @@ static int namespace_destroy(struct ndctl_region *region,
 			 * stopping the !bdev case from racing to mount an fs or
 			 * re-enabling the namepace.
 			 */
-			return -EBUSY;
+			error("%s: %s failed exlusive open: %s\n",
+					devname, bdev, strerror(errno));
+			return -errno;
 		}
 	}
 

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2016-04-25 19:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 19:49 [ndctl PATCH 0/7] miscellaneous fixes Dan Williams
2016-04-25 19:49 ` Dan Williams [this message]
2016-04-25 19:49 ` [ndctl PATCH 2/7] ndctl, create-namespace: check for ZONE_DEVICE=n kernels Dan Williams
2016-04-25 19:50 ` [ndctl PATCH 3/7] ndctl: fix some warnings Dan Williams
2016-04-25 19:50 ` [ndctl PATCH 4/7] ndctl: drop asciidocs and xmlto requirement for --disable-docs Dan Williams
2016-04-25 19:50 ` [ndctl PATCH 5/7] ndctl: fix to_dsm_index() static analysis warning Dan Williams
2016-04-26 18:10   ` Dan Williams
2016-04-25 19:50 ` [ndctl PATCH 6/7] ndctl: fix uninitialized variable in add_dimm() Dan Williams
2016-04-25 19:50 ` [ndctl PATCH 7/7] ndctl: fix unchecked return value Dan Williams

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=146161379487.21779.8389169524298318569.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.