From: Christoph Hellwig <hch@lst.de>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>,
Chao Leng <lengchao@huawei.com>,
linux-nvme@lists.infradead.org,
Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Subject: Re: [PATCH 0/3 rfc] Fix nvme-tcp and nvme-rdma controller reset hangs
Date: Sat, 20 Mar 2021 07:11:23 +0100 [thread overview]
Message-ID: <20210320061123.GA20852@lst.de> (raw)
In-Reply-To: <ac05c7cc-3613-ec8c-a718-6f3e74710b42@grimberg.me>
On Fri, Mar 19, 2021 at 12:34:25PM -0700, Sagi Grimberg wrote:
>
>> diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
>> index a1d476e1ac020f..92adebfaf86fd1 100644
>> --- a/drivers/nvme/host/multipath.c
>> +++ b/drivers/nvme/host/multipath.c
>> @@ -309,6 +309,7 @@ blk_qc_t nvme_ns_head_submit_bio(struct bio *bio)
>> */
>> blk_queue_split(&bio);
>> +retry:
>> srcu_idx = srcu_read_lock(&head->srcu);
>> ns = nvme_find_path(head);
>> if (likely(ns)) {
>> @@ -316,7 +317,12 @@ blk_qc_t nvme_ns_head_submit_bio(struct bio *bio)
>> bio->bi_opf |= REQ_NVME_MPATH;
>> trace_block_bio_remap(bio, disk_devt(ns->head->disk),
>> bio->bi_iter.bi_sector);
>> - ret = submit_bio_noacct(bio);
>> +
>> + if (!blk_mq_submit_bio_direct(bio, &ret)) {
>> + nvme_mpath_clear_current_path(ns);
>> + srcu_read_unlock(&head->srcu, srcu_idx);
>
> Its a bit unusual to see mutation of a data protected by srcu while
> under the srcu_read_lock, can that be problematic somehow?
Hmm. I don't think head->srcu is intended to protect the current path.
We also call nvme_mpath_clear_current_path from nvme_complete_rq or
nvme_ns_remove, which has no locking at all. The srcu protection is
for head->list, but leaks into the current path due to the __rcu
annotations.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2021-03-20 6:11 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 22:27 [PATCH 0/3 rfc] Fix nvme-tcp and nvme-rdma controller reset hangs Sagi Grimberg
2021-03-15 22:27 ` [PATCH 1/3] nvme: introduce nvme_ctrl_is_mpath helper Sagi Grimberg
2021-03-15 22:27 ` [PATCH 2/3] nvme-tcp: fix possible hang when trying to set a live path during I/O Sagi Grimberg
2021-03-15 22:27 ` [PATCH 3/3] nvme-rdma: " Sagi Grimberg
2021-03-16 3:24 ` [PATCH 0/3 rfc] Fix nvme-tcp and nvme-rdma controller reset hangs Chao Leng
2021-03-16 5:04 ` Sagi Grimberg
2021-03-16 6:18 ` Chao Leng
2021-03-16 6:25 ` Sagi Grimberg
2021-03-16 20:07 ` Sagi Grimberg
2021-03-16 20:42 ` Keith Busch
2021-03-16 23:51 ` Sagi Grimberg
2021-03-17 2:55 ` Chao Leng
2021-03-17 6:59 ` Christoph Hellwig
2021-03-17 7:59 ` Chao Leng
2021-03-17 18:43 ` Sagi Grimberg
2021-03-18 1:51 ` Chao Leng
2021-03-18 4:45 ` Christoph Hellwig
2021-03-18 18:46 ` Sagi Grimberg
2021-03-18 19:16 ` Keith Busch
2021-03-18 19:31 ` Sagi Grimberg
2021-03-18 21:52 ` Keith Busch
2021-03-18 22:45 ` Sagi Grimberg
2021-03-19 14:05 ` Christoph Hellwig
2021-03-19 17:28 ` Christoph Hellwig
2021-03-19 19:07 ` Keith Busch
2021-03-19 19:34 ` Sagi Grimberg
2021-03-20 6:11 ` Christoph Hellwig [this message]
2021-03-21 6:49 ` Sagi Grimberg
2021-03-22 6:34 ` Christoph Hellwig
2021-03-17 8:16 ` Sagi Grimberg
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=20210320061123.GA20852@lst.de \
--to=hch@lst.de \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=kbusch@kernel.org \
--cc=lengchao@huawei.com \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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;
as well as URLs for NNTP newsgroup(s).