mirror of
https://github.com/torvalds/linux.git
synced 2026-12-05 12:54:27 +00:00
Commit888baf069f("scsi: cxlflash: Add kref to context") introduced a kref to the context. In particular, the detach routine was updated to use the kref services for managing the removal and destruction of a context. As part of this change, the tracking mechanism internal to the detach handler was refactored. This introduced a bug that can cause the tracking state to be lost. This can lead to a situation where exclusive access to a context is prematurely [and unknowingly] relinquished for the executing thread. To remedy, only update the tracking state when the kref operation indicates the context was removed. Fixes:888baf069f("scsi: cxlflash: Add kref to context") Signed-off-by: Matthew R. Ochs <[email protected]> Acked-by: Uma Krishnan <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>