]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi: scsi_debug: Do not sleep in atomic sections
authorBart Van Assche <bvanassche@acm.org>
Mon, 24 Feb 2025 11:55:17 +0000 (11:55 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 25 Feb 2025 01:53:07 +0000 (20:53 -0500)
commitac0fb4a55bde561c46fc7445642a722803176b33
treee41e8d5414578305da68fd2e02ab3ce3130c8d56
parentb441eafbd1ebb37676ba271295bf98ca8c8c6dfb
scsi: scsi_debug: Do not sleep in atomic sections

Function stop_qc_helper() is called while the debug_scsi_cmd lock is held,
and from here we may call cancel_work_sync(), which may sleep.

Sleeping in atomic sections is not allowed.

Hence change the cancel_work_sync() call into a cancel_work() call.

However now it is not possible to know if the work callback is running when
we return. This is relevant for eh_abort_handler handling, as the semantics
of that callback are that success means that we do not keep a reference to
the scsi_cmnd - now this is not possible. So return FAIL when we are unsure
if the callback still running.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
jpg: return FAILED from scsi_debug_abort() when possible callback running
Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20250224115517.495899-5-john.g.garry@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_debug.c