[PATCHv4 6/8] nvme: export I/O failure count when no path is available via sysfs
John Garry
john.g.garry at oracle.com
Thu Jul 2 01:15:39 PDT 2026
On 16/05/2026 19:36, Nilay Shroff wrote:
> +
I'm just looking at this now for the scsi multipath/libmultipath work.
> +static ssize_t io_fail_no_available_path_count_store(struct device *dev,
> + struct device_attribute *attr, const char *buf, size_t count)
> +{
> + int err;
> + unsigned long fail_cnt;
> + struct gendisk *disk = dev_to_disk(dev);
> + struct nvme_ns_head *head = disk->private_data;
> +
> + err = kstrtoul(buf, 0, &fail_cnt);
is fail_cnt ever going to be non-zero? I assume that we allow the value
to be stored to just reset the counter (to zero).
> + if (err)
> + return -EINVAL;
> +
> + atomic_long_set(&head->io_fail_no_available_path_count, fail_cnt);
> +
> + return count;
> +}
> +
> +DEVICE_ATTR_RW(io_fail_no_available_path_count);
Thanks,
John
More information about the Linux-nvme
mailing list