From: Dan Williams <dan.j.williams@intel.com>
To: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH] ndctl: support machines without numa
Date: Wed, 04 Jan 2017 16:15:57 -0800 [thread overview]
Message-ID: <148357532903.9100.4272827749663933501.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
From: Diego Dompe <dompe@hpe.com>
Currently when using ndctl in machines that do not have numa, the ndctl
command fails because it fails to find the numa_node attribute in
systems.
Just assume the default, zero, in these cases rather than fail.
Link: https://github.com/pmem/ndctl/pull/9
[djbw: minor style fixups]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
Diego, if this reworked version looks good to you I'll add your
"Signed-off-by: Diego Dompe <dompe@hpe.com>" to the tags. Let me know.
Thanks for the fix!
ndctl/lib/libndctl.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index ea3111eb6c93..8240235dff5c 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -2780,9 +2780,8 @@ static void *add_namespace(void *parent, int id, const char *ndns_base)
ndns->raw_mode = strtoul(buf, NULL, 0);
sprintf(path, "%s/numa_node", ndns_base);
- if (sysfs_read_attr(ctx, path, buf) < 0)
- goto err_read;
- ndns->numa_node = strtol(buf, NULL, 0);
+ if (sysfs_read_attr(ctx, path, buf) == 0)
+ ndns->numa_node = strtol(buf, NULL, 0);
switch (ndns->type) {
case ND_DEVICE_NAMESPACE_BLK:
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next reply other threads:[~2017-01-05 0:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 0:15 Dan Williams [this message]
[not found] ` <148357532903.9100.4272827749663933501.stgit-p8uTFz9XbKj2zm6wflaqv1nYeNYlB/vhral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-01-05 14:55 ` [ndctl PATCH] ndctl: support machines without numa Jeff Moyer
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=148357532903.9100.4272827749663933501.stgit@dwillia2-desk3.amr.corp.intel.com \
--to=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.