From: Christoph Hellwig <hch@lst.de>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@meta.com>,
linux-nvme@lists.infradead.org, Keith Busch <kbusch@kernel.org>,
Minh Hoang <mh2022@meta.com>
Subject: Re: [PATCH] nvme: ensure reset state check ordering
Date: Mon, 20 Nov 2023 15:26:48 +0100 [thread overview]
Message-ID: <20231120142648.GA7139@lst.de> (raw)
In-Reply-To: <0e19bd16-a544-457e-aecd-70b7ff6433cc@grimberg.me>
On Mon, Nov 20, 2023 at 03:53:59PM +0200, Sagi Grimberg wrote:
>
>>> From: Keith Busch <kbusch@kernel.org>
>>>
>>> A different CPU may be setting the ctrl->state value while flushing the
>>> reset work, so ensure proper barriers to prevent reading a stale state.
>>> Reading the wrong state can report unexpected ENETRESET errors when
>>> everything was successful.
>>
>> smp_load_acquire needs to be paired with a smp_store_release.
>>
>> We should either always hold the lock or use WRITE_ONCE/READ_ONCE
>
> which lock?
in this case: ctrl->lock.
next prev parent reply other threads:[~2023-11-20 14:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-27 18:07 [PATCH] nvme: ensure reset state check ordering Keith Busch
2023-10-30 13:27 ` Christoph Hellwig
2023-11-20 13:53 ` Sagi Grimberg
2023-11-20 14:26 ` Christoph Hellwig [this message]
2023-11-20 14:36 ` 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=20231120142648.GA7139@lst.de \
--to=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--cc=linux-nvme@lists.infradead.org \
--cc=mh2022@meta.com \
--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