Re: [PATCH] scsi: core: Protect host_busy reads against tag set teardown
From: Bart Van Assche
Date: Wed Dec 02 2026 - 10:07:51 EST
On 12/2/26 4:04 AM, Shuo Qin wrote:
show_host_busy() can race with SCSI host removal. scsi_remove_host()
drops the host's tagset_refcnt reference and waits for the tag set to
be freed before unregistering shost_dev. During this interval the
host_busy attribute is still accessible, but its callback does not
hold a tag set reference while calling scsi_host_busy().
Why has the approach of this patch been selected instead of adding a
kref_get() call before scsi_remove_host() and a kref_put() call after
shost_busy has been removed?
Thanks,
Bart.