Linux CXL
 help / color / mirror / Atom feed
From: "Cheatham, Benjamin" <benjamin.cheatham@amd.com>
To: Dave Jiang <dave.jiang@intel.com>, <nvdimm@lists.linux.dev>
Cc: <linux-cxl@vger.kernel.org>, <alison.schofield@intel.com>
Subject: Re: [PATCH v4 2/7] libcxl: Add CXL protocol errors
Date: Fri, 12 Dec 2025 10:10:00 -0600	[thread overview]
Message-ID: <0fcc8081-262e-4028-8920-70d12b835e37@amd.com> (raw)
In-Reply-To: <1a82d5be-3126-4b04-a5ac-da651c33a21b@intel.com>

[snip]

>> +
>> +static void cxl_add_protocol_errors(struct cxl_ctx *ctx)
>> +{
>> +	struct cxl_protocol_error *perror;
>> +	char buf[SYSFS_ATTR_SIZE];
>> +	char *path, *num, *save;
>> +	size_t path_len, len;
>> +	unsigned long n;
>> +	int rc = 0;
>> +
>> +	if (!ctx->debugfs)
>> +		return;
>> +
>> +	path_len = strlen(ctx->debugfs) + 100;
>> +	path = calloc(1, path_len);
>> +	if (!path)
>> +		return;
>> +
>> +	len = snprintf(path, path_len, "%s/cxl/einj_types", ctx->debugfs);
>> +	if (len >= path_len) {
>> +		err(ctx, "Buffer too small\n");
>> +		goto err;
>> +	}
>> +
>> +	rc = access(path, F_OK);
>> +	if (rc) {
>> +		err(ctx, "failed to access %s: %s\n", path, strerror(errno));
>> +		goto err;
>> +	}
>> +
>> +	rc = sysfs_read_attr(ctx, path, buf);
>> +	if (rc) {
>> +		err(ctx, "failed to read %s: %s\n", path, strerror(errno));
> 
> sysfs_read_attr() is a local lib function and not glibc. It returns -errno and does not set errno. See util/sysfs.c.
> 

Yep, that was me being lazy and not paying attention. Will this (and the one below) for v5.

Thanks,
Ben


  reply	other threads:[~2025-12-12 16:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09 17:13 [ndctl PATCH v4 0/7] Add error injection support Ben Cheatham
2025-12-09 17:13 ` [PATCH v4 1/7] libcxl: Add debugfs path to CXL context Ben Cheatham
2025-12-10 18:19   ` Dave Jiang
2025-12-12 16:09     ` Cheatham, Benjamin
2025-12-09 17:13 ` [PATCH v4 2/7] libcxl: Add CXL protocol errors Ben Cheatham
2025-12-10 19:54   ` Dave Jiang
2025-12-12 16:10     ` Cheatham, Benjamin [this message]
2025-12-09 17:14 ` [PATCH v4 3/7] libcxl: Add poison injection support Ben Cheatham
2025-12-10 20:06   ` Dave Jiang
2025-12-10 20:09   ` Dave Jiang
2025-12-09 17:14 ` [PATCH v4 4/7] cxl: Add inject-error command Ben Cheatham
2025-12-10 20:10   ` Dave Jiang
2025-12-09 17:14 ` [PATCH v4 5/7] cxl: Add clear-error command Ben Cheatham
2025-12-10 20:11   ` Dave Jiang
2025-12-09 17:14 ` [PATCH v4 6/7] cxl/list: Add injectable errors in output Ben Cheatham
2025-12-10 20:13   ` Dave Jiang
2025-12-09 17:14 ` [PATCH v4 7/7] Documentation: Add docs for inject/clear-error commands Ben Cheatham
2025-12-10 20:15   ` Dave Jiang

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=0fcc8081-262e-4028-8920-70d12b835e37@amd.com \
    --to=benjamin.cheatham@amd.com \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox