From: Bart Van Assche <bvanassche@acm.org>
To: Chaohai Chen <wdhh6@aliyun.com>,
James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, dlemoal@kernel.org,
hch@infradead.org
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] scsi: core: Fix async_scan race condition with READ_ONCE/WRITE_ONCE
Date: Wed, 4 Mar 2026 08:25:16 -0600 [thread overview]
Message-ID: <3d9c22b4-1b1f-4432-a6ed-eaa2494e4ace@acm.org> (raw)
In-Reply-To: <20260304092939.3092102-1-wdhh6@aliyun.com>
On 3/4/26 3:29 AM, Chaohai Chen wrote:
> - if (!shost->async_scan) {
> + if (!READ_ONCE(shost->async_scan)) {
Yikes. I'm not aware of any other kernel code that uses READ_ONCE() /
WRITE_ONCE() to access a member variable protected by a mutex. Please
annotate the async_scan member variable with __guarded_by() and drop the
READ_ONCE() and WRITE_ONCE() invocations introduced by this patch.
Bart.
prev parent reply other threads:[~2026-03-04 14:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 9:29 [PATCH v4] scsi: core: Fix async_scan race condition with READ_ONCE/WRITE_ONCE Chaohai Chen
2026-03-04 14:25 ` Bart Van Assche [this message]
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=3d9c22b4-1b1f-4432-a6ed-eaa2494e4ace@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=dlemoal@kernel.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=wdhh6@aliyun.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox