All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ross Zwisler <ross.zwisler@linux.intel.com>
To: linux-nvdimm@lists.01.org, dan.j.williams@intel.com
Subject: [PATCH 1/3] ndctl: don't print erroneous namespace numa_nodes
Date: Wed,  7 Mar 2018 11:02:35 -0700	[thread overview]
Message-ID: <20180307180237.9289-1-ross.zwisler@linux.intel.com> (raw)

If the kernel has CONFIG_NUMA unset namespaces in sysfs will lack a
numa_node attribute.  In such cases ndctl will report a value of 0 for the
namespace numa_node in 'ndctl list'.  Instead of reporting potentially bad
data just hide the numa_node field if it is unsupported.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Fixes: commit f7d3de80a121 ("ndctl: support machines without numa")
---
 ndctl/lib/libndctl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index ed5a65b..b7180e8 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -3008,6 +3008,8 @@ static void *add_namespace(void *parent, int id, const char *ndns_base)
 	sprintf(path, "%s/numa_node", ndns_base);
 	if (sysfs_read_attr(ctx, path, buf) == 0)
 		ndns->numa_node = strtol(buf, NULL, 0);
+	else
+		ndns->numa_node = -1;
 
 	sprintf(path, "%s/holder_class", ndns_base);
 	if (sysfs_read_attr(ctx, path, buf) == 0)
-- 
2.14.3

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

             reply	other threads:[~2018-03-07 17:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 18:02 Ross Zwisler [this message]
2018-03-07 18:02 ` [PATCH 2/3] ndctl: add numa_node support for regions Ross Zwisler
2018-03-07 18:25   ` Dan Williams
2018-03-07 18:02 ` [PATCH 3/3] ndctl: add filtering based on numa_node Ross Zwisler
2018-03-07 18:36   ` Dan Williams
2018-03-07 18:46     ` Ross Zwisler
2018-03-07 18:53     ` [PATCH v2 " Ross Zwisler
2018-03-07 19:00       ` Dan Williams
2018-03-07 20:42       ` Verma, Vishal L
2018-03-07 20:48         ` Dan Williams
2018-03-07 20:50           ` Verma, Vishal L
2018-03-08 17:21           ` Ross Zwisler
2018-03-08 17:50             ` Dan Williams
2018-03-08 21:08       ` Vishal Verma
2018-03-08 23:57         ` Ross Zwisler
2018-03-08 23:02       ` [PATCH v3 3/3] ndctl: add filtering based on numa node Ross Zwisler
2018-03-07 18:23 ` [PATCH 1/3] ndctl: don't print erroneous namespace numa_nodes 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=20180307180237.9289-1-ross.zwisler@linux.intel.com \
    --to=ross.zwisler@linux.intel.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.