Re: [PATCHv4 6/8] nvme: export I/O failure count when no path is available via sysfs

John Garry <[email protected]>
Newsgroups org.infradead.lists.linux-nvme
Organization Oracle Corporation
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.