Re: [PATCH v5] scsi: core: Drop using the host_lock to protect async_scan race condition

From: John Garry

Date: Thu Mar 05 2026 - 11:25:28 EST


On 05/03/2026 02:51, Chaohai Chen wrote:
Previously, host_lock was used to prevent bit-set conflicts in async_scan,
but this approach introduced naked reads in some code paths.

Convert async_scan from a bitfield to a bool type to eliminate bit-level
conflicts entirely. Use __guarded_by(&scan_mutex) to indicate that the
async_scan variable is protected by scan_mutex.

Signed-off-by: Chaohai Chen<wdhh6@xxxxxxxxxx>


Reviewed-by: John Garry <john.g.garry@xxxxxxxxxx>