daxctl: phys_index value 0 is valid
PATCH 1/1 daxctl: phys_index value 0 is valid
On power platforms we can find
# cat /sys/devices/system/memory/memory0/phys_index 00000000
This results in
libdaxctl: memblock_in_dev: dax1.0: memory0: Unable to determine phys_index: Success
Avoid considering phys_index == 0 as error.
--- daxctl/lib/libdaxctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
daxctl/lib/libdaxctl.c +1 -1
@@ -1229,7 +1229,7 @@ static int memblock_in_dev(struct daxctl_memory *mem, const char *memblock) rc =sysfs_read_attr (ctx, path, buf);if (rc ==0 ) { phys_index =strtoul (buf,NULL ,16 ); -if (phys_index ==0 || phys_index ==ULONG_MAX ) { +if (phys_index ==ULONG_MAX ) { rc = -errno;err (ctx,"%s: %s: Unable to determine phys_index: %s\n" , devname, memblock,strerror (-rc));
Signature · 4 lines
2.26.2 _______________________________________________ Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Hi All,
Quoted 9 lines · Aneesh Kumar K.V
On power platforms we can find
# cat /sys/devices/system/memory/memory0/phys_index 00000000This results in
libdaxctl:
memblock_in_dev: dax1.0: memory0: Unable to determinephys_index: SuccessAvoid considering
phys_index== 0 as error.
A gentle ping for this patch. Will appreciate a feedback on this
Quoted 21 lines
Signed-off-by Aneesh Kumar K.V <[email protected]>--- daxctl/lib/libdaxctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)daxctl/lib/libdaxctl.c +1
-1@@ -1229,7 +1229,7 @@ static int memblock_in_dev(struct daxctl_memory *mem, const char *memblock) rc =sysfs_read_attr (ctx, path, buf);if (rc ==0 ) { phys_index =strtoul (buf,NULL ,16 ); -if (phys_index ==0 || phys_index ==ULONG_MAX ) { +if (phys_index ==ULONG_MAX ) { rc = -errno;err (ctx,"%s: %s: Unable to determine phys_index: %s\n" , devname, memblock,strerror (-rc));Signature · 1 line
2.26.2
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Dan Williams
Reviewed-byQuoted 10 lines · Aneesh Kumar K.V
Hi All,
Quoted 4 lines · Aneesh Kumar K.V
On power platforms we can find
# cat /sys/devices/system/memory/memory0/phys_index 00000000
Quoted 8 lines
Quoted 5 lines
This results in
libdaxctl:
memblock_in_dev: dax1.0: memory0: Unable to determinephys_index: SuccessAvoid considering
phys_index== 0 as error.A gentle ping for this patch. Will appreciate a feedback on this
Looks good to me. Apologies for the delay.
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]