From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH] nvme: avoid hang on inaccessible paths
Date: Wed, 30 May 2018 14:12:41 +0200 [thread overview]
Message-ID: <20180530121241.GA1850@lst.de> (raw)
In-Reply-To: <20180530111637.22223-1-hare@suse.de>
> - /* XXX: try an inaccessible path as last resort per 8.18.3.3 */
> + if (!ns)
> + ns = __nvme_find_path(head, NVME_ANA_INACCESSIBLE);
This at least needs to keep a comment on why we are aiming for an
inaccessible path.
> @@ -165,10 +166,14 @@ static blk_qc_t nvme_ns_head_make_request(struct request_queue *q,
>
> srcu_idx = srcu_read_lock(&head->srcu);
> ns = nvme_find_path(head);
> - if (likely(ns)) {
> + if (likely(ns && nvme_ns_ana_state(ns) != NVME_ANA_INACCESSIBLE)) {
> bio->bi_disk = ns->disk;
> bio->bi_opf |= REQ_NVME_MPATH;
> ret = direct_make_request(bio);
We should actually sometimes try to issue I/O on an inaccessible path.
Please take a look at Section 8.18.3.3 in the ANA TP. Similar handling
would also apply to change states, which we'd also need to cover here
and above.
> + } else if (ns) {
> + bio->bi_status = BLK_STS_TRANSPORT;
> + bio_set_flag(bio, BIO_QUIET);
> + bio_endio(bio);
> } else if (!list_empty_careful(&head->list)) {
> dev_warn_ratelimited(dev, "no path available - requeuing I/O\n");
But a case where we only have inaccessible / change states isn't
really different from the no path available, requeing case.
Now it might make sense to have a (configurable) timeout to give
up in all those case, and if my vague memory serves me right you
actually volunteered to implement that a while ago.
next prev parent reply other threads:[~2018-05-30 12:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-30 11:16 [PATCH] nvme: avoid hang on inaccessible paths Hannes Reinecke
2018-05-30 12:12 ` Christoph Hellwig [this message]
2018-05-30 12:30 ` Hannes Reinecke
2018-05-30 12:54 ` Christoph Hellwig
2018-05-30 23:10 ` Sagi Grimberg
2018-06-04 6:24 ` Hannes Reinecke
2018-06-04 6:37 ` Christoph Hellwig
2018-06-04 12:17 ` Sagi Grimberg
2018-06-04 12:56 ` Christoph Hellwig
2018-06-06 19:02 ` Popuri, Sriram
2018-06-07 5:54 ` Hannes Reinecke
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=20180530121241.GA1850@lst.de \
--to=hch@lst.de \
/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