All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Santosh Sivaraj <santosh@fossix.org>
Cc: linux-nvdimm <linux-nvdimm@lists.01.org>, harish@linux.ibm.com
Subject: Re: [PATCH ndctl] ndctl/namespace: Fix enable-namespace error for seed namespaces
Date: Fri, 10 Jan 2020 09:56:26 -0800	[thread overview]
Message-ID: <CAPcyv4h-ke4Jorqx6md+gfgVupNgXn-qm8Yx7vaLNa4O+91jeg@mail.gmail.com> (raw)
In-Reply-To: <20200110082017.3485529-1-santosh@fossix.org>

On Fri, Jan 10, 2020 at 12:21 AM Santosh Sivaraj <santosh@fossix.org> wrote:
>
> 'ndctl enable-namespace all' tries to enable seed namespaces too, which results
> in a error like
>
> libndctl: ndctl_namespace_enable: namespace1.0: failed to enable
>
> Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
> ---
>  ndctl/lib/libndctl.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
> index 6596f94..4839214 100644
> --- a/ndctl/lib/libndctl.c
> +++ b/ndctl/lib/libndctl.c
> @@ -4010,11 +4010,16 @@ NDCTL_EXPORT int ndctl_namespace_enable(struct ndctl_namespace *ndns)
>         const char *devname = ndctl_namespace_get_devname(ndns);
>         struct ndctl_ctx *ctx = ndctl_namespace_get_ctx(ndns);
>         struct ndctl_region *region = ndns->region;
> +       unsigned long long size = ndctl_namespace_get_size(ndns);
>         int rc;
>
>         if (ndctl_namespace_is_enabled(ndns))
>                 return 0;
>
> +       /* Don't try to enable idle namespace (no capacity allocated) */
> +       if (size == 0)
> +               return -1;

Concept looks good to me, just resend with that -1 changed to a named
error code (-ENXIO).
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

      reply	other threads:[~2020-01-10 17:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09  4:17 [ndctl PATCH] ndctl/namespace: Fix destroy-namespace accounting relative to seed devices Dan Williams
2020-01-10  8:20 ` [PATCH ndctl] ndctl/namespace: Fix enable-namespace error for seed namespaces Santosh Sivaraj
2020-01-10 17:56   ` Dan Williams [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=CAPcyv4h-ke4Jorqx6md+gfgVupNgXn-qm8Yx7vaLNa4O+91jeg@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --cc=harish@linux.ibm.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=santosh@fossix.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.