[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7f9fa4eb-01fb-4581-badf-535f634d0152@acm.org>
Date: Tue, 24 Oct 2023 12:03:36 -0700
From: Bart Van Assche <bvanassche@....org>
To: Tuo Li <islituo@...il.com>, sathya.prakash@...adcom.com,
sreekanth.reddy@...adcom.com, suganath-prabu.subramani@...adcom.com
Cc: MPT-FusionLinux.pdl@...adcom.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org, baijiaju1990@...look.com,
BassCheck <bass@...a.edu.cn>
Subject: Re: [PATCH] scsi: message: fusion: Fix a possible data race in
mpt_ioc_reset()
On 10/24/23 00:27, Tuo Li wrote:
> In my opinion, this may be a harmful race, because the value of
> ioc->taskmgmt_quiesce_io can be rewritten by mpt_ioc_reset() when
> another thread is accessing it.
It is a common pattern in the Linux kernel that a variable is set from
one thread without using locking and is read by another thread that is
holding a lock. It should be sufficient here to use WRITE_ONCE(). I
don't think that acquiring and releasing the spin lock is required.
Thanks,
Bart.
Powered by blists - more mailing lists