On Wed, Mar 7, 2018 at 10:02 AM, Ross Zwisler
<ross.zwis...@linux.intel.com> wrote:
> 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.zwis...@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;

Looks good.

Reviewed-by: Dan Williams <dan.j.willi...@intel.com>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to