nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Oliver O'Halloran <oohall@gmail.com>
Cc: linux-nvdimm <linux-nvdimm@lists.01.org>
Subject: Re: [PATCH 4/4] ndctl/namespace: Validate alignment from the {pfn|dax} seed
Date: Sun, 25 Nov 2018 12:18:16 -0800	[thread overview]
Message-ID: <CAPcyv4jLP47oN3c2y+BaQw5cFYG+EP_LEF3pqhjyCckUj7BcDg@mail.gmail.com> (raw)
In-Reply-To: <20181119080056.13386-4-oohall@gmail.com>

On Mon, Nov 19, 2018 at 12:11 AM Oliver O'Halloran <oohall@gmail.com> wrote:
>
> This patch adds support to the ndctl tool for validating that the
> namespace alignment is valid.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
> ---
>  ndctl/namespace.c | 32 ++++++++++++++++++++++++--------
>  1 file changed, 24 insertions(+), 8 deletions(-)
>
> diff --git a/ndctl/namespace.c b/ndctl/namespace.c
> index 1e04f32c0e95..6f8dca288527 100644
> --- a/ndctl/namespace.c
> +++ b/ndctl/namespace.c
> @@ -537,8 +537,18 @@ static int validate_namespace_options(struct ndctl_region *region,
>         }
>
>         if (param.align) {
> -               if (p->mode != NDCTL_NS_MODE_MEMORY &&
> -                   p->mode != NDCTL_NS_MODE_DAX) {
> +               int i, alignments;
> +
> +               switch (p->mode) {
> +               case NDCTL_NS_MODE_MEMORY:
> +                       alignments = ndctl_pfn_get_num_alignments(pfn);
> +                       break;
> +
> +               case NDCTL_NS_MODE_DAX:
> +                       alignments = ndctl_dax_get_num_alignments(dax);
> +                       break;
> +

This needs to be reworked after addressing the patch-2 comment because
the "(!pfn || !ndctl_pfn_has_align(pfn)))" was handling the
"memory-mode without pfn device" case.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2018-11-25 20:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19  8:00 [PATCH 1/4] libndctl: Use the supported_alignment attribute Oliver O'Halloran
2018-11-19  8:00 ` [PATCH 2/4] ndctl/namespace: Check for seed namespaces earlier Oliver O'Halloran
2018-11-25 20:12   ` Dan Williams
2018-11-27 13:27     ` Oliver
2019-01-08  2:59       ` Dan Williams
2019-01-08 11:00         ` Oliver
2018-11-19  8:00 ` [PATCH 3/4] ndctl/namespace: Use seed alignment as the default Oliver O'Halloran
2018-11-25 20:14   ` Dan Williams
2018-11-19  8:00 ` [PATCH 4/4] ndctl/namespace: Validate alignment from the {pfn|dax} seed Oliver O'Halloran
2018-11-25 20:18   ` Dan Williams [this message]
2018-11-25 20:06 ` [PATCH 1/4] libndctl: Use the supported_alignment attribute 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=CAPcyv4jLP47oN3c2y+BaQw5cFYG+EP_LEF3pqhjyCckUj7BcDg@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=oohall@gmail.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).