All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ndctl: don't print erroneous namespace numa_nodes
@ 2018-03-07 18:02 Ross Zwisler
  2018-03-07 18:02 ` [PATCH 2/3] ndctl: add numa_node support for regions Ross Zwisler
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Ross Zwisler @ 2018-03-07 18:02 UTC (permalink / raw)
  To: linux-nvdimm, dan.j.williams

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

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-03-08 23:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-07 18:02 [PATCH 1/3] ndctl: don't print erroneous namespace numa_nodes Ross Zwisler
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

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.