All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linda Knippers <linda.knippers@hpe.com>
To: Dan Williams <dan.j.williams@intel.com>, linux-nvdimm@lists.01.org
Subject: Re: [ndctl PATCH 4/8] ndctl, create-namespace: report failures due to namespace being mounted
Date: Fri, 22 Apr 2016 19:00:17 -0400	[thread overview]
Message-ID: <571AAD01.3080801@hpe.com> (raw)
In-Reply-To: <146135444310.4228.7151000859132505494.stgit@dwillia2-desk3.amr.corp.intel.com>

On 4/22/2016 3:47 PM, Dan Williams wrote:
> 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.
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  builtin-xaction-namespace.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/builtin-xaction-namespace.c b/builtin-xaction-namespace.c
> index 53ff82bc2c8d..e2e6d518c64d 100644
> --- a/builtin-xaction-namespace.c
> +++ b/builtin-xaction-namespace.c
> @@ -550,6 +550,8 @@ static int namespace_destroy(struct ndctl_region *region,
>  			 * stopping the !bdev case from racing to mount an fs or
>  			 * re-enabling the namepace.
>  			 */
> +			error("%s: %s is mounted, failing operation\n",
> +					devname, bdev);

I'm seeing this error message in cases where the device is not mounted,
such as when I forget to run ndctl as root/sudo.  That's a more
likely reason that the open() may fail.  Perhaps you could check the
errno from the open() failure and display an error based on that?
You might simply do a perror().

-- ljk

>  			return -EBUSY;
>  		}
>  	}
> 
> _______________________________________________
> Linux-nvdimm mailing list
> Linux-nvdimm@lists.01.org
> https://lists.01.org/mailman/listinfo/linux-nvdimm
> 
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2016-04-22 23:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 19:47 [ndctl PATCH 0/8] create-namespace fixes, and a misc build fix Dan Williams
2016-04-22 19:47 ` [ndctl PATCH 1/8] ndctl, create-namespace: make zero_info_block() more robust Dan Williams
2016-04-22 19:47 ` [ndctl PATCH 2/8] ndctl: new 'destroy-namespace' utility Dan Williams
2016-04-22 19:47 ` [ndctl PATCH 3/8] ndctl: fix build on systems where /bin/sh is not a link to bash Dan Williams
2016-04-22 19:47 ` [ndctl PATCH 4/8] ndctl, create-namespace: report failures due to namespace being mounted Dan Williams
2016-04-22 23:00   ` Linda Knippers [this message]
2016-04-22 23:10     ` Dan Williams
2016-04-22 19:47 ` [ndctl PATCH 5/8] ndctl, xaction-namespace: make 'verbose' option available in all sub-commands Dan Williams
2016-04-22 19:47 ` [ndctl PATCH 6/8] ndctl, create-namespace: fix memmap location reconfiguration Dan Williams
2016-04-22 19:47 ` [ndctl PATCH 7/8] ndctl, create-namespace: fix sector mode default for pmem namespaces Dan Williams
2016-04-22 23:07   ` Linda Knippers
2016-04-22 19:47 ` [ndctl PATCH 8/8] ndctl, create-namespace: check for ZONE_DEVICE=n kernels 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=571AAD01.3080801@hpe.com \
    --to=linda.knippers@hpe.com \
    --cc=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.