Commit ac0fb4a
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 <[email protected]>
jpg: return FAILED from scsi_debug_abort() when possible callback running
Signed-off-by: John Garry <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin K. Petersen <[email protected]>1 parent b441eaf commit ac0fb4a
1 file changed
+10
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6655 | 6655 | | |
6656 | 6656 | | |
6657 | 6657 | | |
6658 | | - | |
| 6658 | + | |
6659 | 6659 | | |
6660 | 6660 | | |
6661 | 6661 | | |
| |||
6668 | 6668 | | |
6669 | 6669 | | |
6670 | 6670 | | |
6671 | | - | |
6672 | 6671 | | |
6673 | 6672 | | |
| 6673 | + | |
6674 | 6674 | | |
6675 | 6675 | | |
6676 | 6676 | | |
6677 | 6677 | | |
6678 | 6678 | | |
6679 | 6679 | | |
6680 | | - | |
| 6680 | + | |
6681 | 6681 | | |
6682 | | - | |
| 6682 | + | |
6683 | 6683 | | |
6684 | 6684 | | |
6685 | 6685 | | |
| |||
6759 | 6759 | | |
6760 | 6760 | | |
6761 | 6761 | | |
6762 | | - | |
| 6762 | + | |
6763 | 6763 | | |
6764 | 6764 | | |
6765 | 6765 | | |
| |||
6768 | 6768 | | |
6769 | 6769 | | |
6770 | 6770 | | |
6771 | | - | |
| 6771 | + | |
| 6772 | + | |
6772 | 6773 | | |
6773 | 6774 | | |
6774 | 6775 | | |
6775 | 6776 | | |
6776 | 6777 | | |
6777 | 6778 | | |
6778 | 6779 | | |
| 6780 | + | |
| 6781 | + | |
| 6782 | + | |
6779 | 6783 | | |
6780 | 6784 | | |
6781 | 6785 | | |
| |||
0 commit comments