All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: John Garry <john.g.garry@oracle.com>, linux-nvme@lists.infradead.org
Cc: dwagner@suse.de, hare@suse.com, kbusch@kernel.org, hch@lst.de,
	sagi@grimberg.me, axboe@kernel.dk, chaitanyak@nvidia.com,
	venkat88@linux.ibm.com, gjoyce@linux.ibm.com,
	wenxiong@linux.ibm.com
Subject: Re: [PATCHv4 6/8] nvme: export I/O failure count when no path is available via sysfs
Date: Thu, 2 Jul 2026 18:40:46 +0530	[thread overview]
Message-ID: <54c163fa-91a1-4535-aded-4beee698591a@linux.ibm.com> (raw)
In-Reply-To: <3bfd53f3-16b7-4585-b528-6745ee64e980@oracle.com>

On 7/2/26 1:45 PM, John Garry wrote:
 > 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).

Yes, this is possible when the namespace head has no available path to
forward I/O. In that case, the counter can become non-zero for a
transient period before the namespace head is deleted. The namespace
head is removed once its reference count drops to zero.

The primary purpose of this attribute is to aid debugging. Under normal
operation, the counter is expected to be zero most of the time because
the namespace head is short-lived after all paths are removed. However,
if there is a subtle bug in the namespace head reference counting logic
that prevents it from being deleted, a non-zero value would remain
visible under:

/sys/block/<nshead-dev>/diag/io_fail_no_available_path_count

And yes this attribute is writable (as all other diag attributes), only
to allow users to reset the counter to zero and then observe subsequent
events.

Thanks,
--Nilay


  reply	other threads:[~2026-07-02 13:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-16 18:36 [PATCHv4 0/8] nvme: export additional diagnostic counters via sysfs Nilay Shroff
2026-05-16 18:36 ` [PATCHv4 1/8] nvme: add diag attribute group under sysfs Nilay Shroff
2026-05-16 18:36 ` [PATCHv4 2/8] nvme: export command retry count via sysfs Nilay Shroff
2026-05-16 18:36 ` [PATCHv4 3/8] nvme: export multipath failover " Nilay Shroff
2026-05-16 18:36 ` [PATCHv4 4/8] nvme: export command error counters " Nilay Shroff
2026-05-16 18:36 ` [PATCHv4 5/8] nvme: export I/O requeue count when no path is usable " Nilay Shroff
2026-05-16 18:36 ` [PATCHv4 6/8] nvme: export I/O failure count when no path is available " Nilay Shroff
2026-07-02  8:15   ` John Garry
2026-07-02 13:10     ` Nilay Shroff [this message]
2026-07-02 14:48       ` John Garry
2026-07-03  6:46         ` Nilay Shroff
2026-05-16 18:36 ` [PATCHv4 7/8] nvme: export controller reset event count " Nilay Shroff
2026-05-16 18:36 ` [PATCHv4 8/8] nvme: export controller reconnect " Nilay Shroff
2026-05-16 18:47 ` [PATCHv4 0/8] nvme: export additional diagnostic counters " Nilay Shroff
2026-05-25  9:12 ` Venkat Rao Bagalkote
2026-05-27 19:54 ` Keith Busch
2026-06-04  8:58 ` Keith Busch

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=54c163fa-91a1-4535-aded-4beee698591a@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=chaitanyak@nvidia.com \
    --cc=dwagner@suse.de \
    --cc=gjoyce@linux.ibm.com \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=john.g.garry@oracle.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=venkat88@linux.ibm.com \
    --cc=wenxiong@linux.ibm.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.