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

From: Martin K. Petersen

Date: Sun Mar 15 2026 - 21:48:39 EST


On Thu, 05 Mar 2026 10:51:24 +0800, 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.
>
> [...]

Applied to 7.1/scsi-queue, thanks!

[1/1] scsi: core: Drop using the host_lock to protect async_scan race condition
https://git.kernel.org/mkp/scsi/c/7a3aff163c77

--
Martin K. Petersen