[PATCH 3/3] nvme: Allow reauth from sysfs

Christoph Hellwig hch at lst.de
Fri Oct 31 07:05:41 PDT 2025


On Thu, Oct 30, 2025 at 01:51:14PM +1000, alistair23 at gmail.com wrote:
> From: Alistair Francis <alistair.francis at wdc.com>
> 
> Allow userspace to trigger a reauth (REPLACETLSPSK) from sysfs.
> This can be done by writing the queue ID to te sysfs file.
> 
> echo 0 > /sys/devices/virtual/nvme-fabrics/ctl/nvme0/replace_psk
> 
> Note that only QID 0 (admin queue) is supported.

Why pass the queue ID then instead of a boolean value?

> +static ssize_t nvme_sysfs_replace_psk(struct device *dev,
> +				      struct device_attribute *attr, const char *buf,
> +				      size_t count)

Overly long line.  And very inefficient annoyoing to modify indentation
compared to:

static ssize_t nvme_sysfs_replace_psk(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count)

> +	rc = kstrtoint(buf, 10, &qid);
> +	if (rc)
> +		return rc;

Nitpick, but nvme style is to use the slightly more descriptive
error and not "rc" which doesn't mean much in general.




More information about the Linux-nvme mailing list