From: Alison Schofield <alison.schofield@intel.com>
To: nvdimm@lists.linux.dev
Cc: Tao Xu <xutao323@gmail.com>,
linux-cxl@vger.kernel.org,
Alison Schofield <alison.schofield@intel.com>
Subject: [ndctl PATCH] util/sysfs: do not fail on missing bind attributes
Date: Thu, 6 Aug 2026 15:31:11 -0700 [thread overview]
Message-ID: <20260806223116.2354715-1-alison.schofield@intel.com> (raw)
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
reply other threads:[~2026-08-06 22:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260806223116.2354715-1-alison.schofield@intel.com \
--to=alison.schofield@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=xutao323@gmail.com \
/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.