* [ndctl PATCH] util/sysfs: do not fail on missing bind attributes
@ 2026-08-06 22:31 Alison Schofield
0 siblings, 0 replies; only message in thread
From: Alison Schofield @ 2026-08-06 22:31 UTC (permalink / raw)
To: nvdimm; +Cc: Tao Xu, linux-cxl, Alison Schofield
From: Tao Xu <xutao323@gmail.com>
Kernel commit cb9cfff82f6a ("cxl/acpi: Simplify cxl_nvdimm_bridge
probing") removed bind attrributes for cxl_pmem_region and
cxl_nvdimm* objects.
__util_bind() currently attempts to write to the bind attribute of
every entry under /sys/bus/cxl/drivers/. On kernels where some driver
directories no longer provide that attribute, these attempts fail with
ENOENT and produce misleading bind errors.
Check that the bind attribute exists before attempting the write.
[ as: commit log edited ]
Reported-by: Tao Xu <xutao323@gmail.com>
Closes: https://github.com/pmem/ndctl/issues/298
Signed-off-by: Tao Xu <xutao323@gmail.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
---
util/sysfs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/util/sysfs.c b/util/sysfs.c
index eaf4b60aacee..2dd4b48b4459 100644
--- a/util/sysfs.c
+++ b/util/sysfs.c
@@ -258,6 +258,11 @@ int __util_bind(const char *devname, struct kmod_module *module,
continue;
}
+ if (access(drv_path, F_OK) != 0) {
+ free(drv_path);
+ continue;
+ }
+
rc = __sysfs_write_attr_quiet(ctx, drv_path, devname);
free(drv_path);
if (rc == 0)
--
2.37.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-06 22:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 22:31 [ndctl PATCH] util/sysfs: do not fail on missing bind attributes Alison Schofield
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.