WSL2-Linux-Kernel/drivers/target
Ahmed S. Darwish bbb087679d scsi: target: core: Remove in_interrupt() check in transport_handle_cdb_direct()
transport_handle_cdb_direct() uses in_interrupt() to detect if it is safe
to sleep. It produces a stack trace and returns with an error which is
clearly for debugging.

The usage of in_interrupt() in drivers is phased out and Linus clearly
requested that code which changes behaviour depending on context should
either be separated or the context be conveyed in an argument passed by the
caller, which usually knows the context.

transport_handle_cdb_direct() has a comment saying that it may only be
invoked from process context. It invokes transport_generic_new_cmd() which
performs GFP_KERNEL memory allocations. in_interrupt() does not detect all
the contexts where it is invalid to sleep (for the blocking GFP_KERNEL
allocation) as it fails to detect sections with disabled preemption.

Replace the in_interrupt() based check with a might_sleep() annotation.

Link: https://lore.kernel.org/r/20201220203638.43615-7-bigeasy@linutronix.de
Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-01-22 20:25:25 -05:00
..
iscsi scsi: target: iscsi: Redo iscsit_check_session_usage_count() return code 2021-01-22 20:25:25 -05:00
loopback scsi: tcm_loop: Allow queues, can_queue and cmd_per_lun to be settable 2020-11-04 22:39:38 -05:00
sbp
tcm_fc scsi: target: Make state_list per CPU 2020-11-04 22:39:38 -05:00
Kconfig
Makefile
target_core_alua.c scsi: target: alua: Remove in_interrupt() usage in core_alua_check_nonop_delay() 2021-01-22 20:25:25 -05:00
target_core_alua.h
target_core_configfs.c
target_core_device.c scsi: target: Make state_list per CPU 2020-11-04 22:39:38 -05:00
target_core_fabric_configfs.c
target_core_fabric_lib.c scsi: target: Handle short iSIDs 2020-07-08 00:14:34 -04:00
target_core_file.c scsi: target: file: Don't zero iter before iov_iter_bvec 2021-01-13 00:09:16 -05:00
target_core_file.h
target_core_hba.c
target_core_iblock.c scsi: target: core: Fix fall-through warnings for Clang 2020-12-02 12:59:47 -05:00
target_core_iblock.h
target_core_internal.h scsi: target: Fix xcopy sess release leak 2020-07-08 00:14:34 -04:00
target_core_pr.c scsi: target: core: Fix fall-through warnings for Clang 2020-12-02 12:59:47 -05:00
target_core_pr.h
target_core_pscsi.c block: remove the nr_sects field in struct hd_struct 2020-12-01 14:53:40 -07:00
target_core_pscsi.h
target_core_rd.c scsi: target: rd: Drop double zeroing 2020-10-07 23:50:03 -04:00
target_core_rd.h
target_core_sbc.c scsi: target: Return COMPARE AND WRITE miscompare offsets 2020-11-04 22:02:43 -05:00
target_core_spc.c
target_core_stat.c
target_core_tmr.c scsi: target: Make state_list per CPU 2020-11-04 22:39:38 -05:00
target_core_tpg.c scsi: target: Drop sess_cmd_lock from I/O path 2020-11-04 22:39:37 -05:00
target_core_transport.c scsi: target: core: Remove in_interrupt() check in transport_handle_cdb_direct() 2021-01-22 20:25:25 -05:00
target_core_ua.c
target_core_ua.h
target_core_user.c SCSI misc on 20201216 2020-12-16 13:34:31 -08:00
target_core_xcopy.c scsi: target: Fix xcopy sess release leak 2020-07-08 00:14:34 -04:00
target_core_xcopy.h