scsi: target: alua: Remove in_interrupt() usage in core_alua_check_nonop_delay()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Sun, 20 Dec 2020 20:36:36 +0000 (21:36 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 23 Jan 2021 01:25:25 +0000 (20:25 -0500)
commita97451ac1e34df5df591c9910b78c84f51f2ec1e
tree3c56748df10addec095b383343c53ac9b5508787
parentf88a10f80da9ed1ab1ba7496b70e9a0cdd8f7cf8
scsi: target: alua: Remove in_interrupt() usage in core_alua_check_nonop_delay()

core_alua_check_nonop_delay() uses in_interrupt() to decide if it is safe
to sleep.

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.

core_alua_check_nonop_delay() has two callers:

 - target_submit_cmd_map_sgls()
   Kernel doc says it that it must be called from process context. Also has
   a BUG_ON(in_interrupt()).

 - iscsit_setup_scsi_cmd()
   Invokes iscsit_add_reject_cmd() which does GFP_KERNEL allocation and
   target_cmd_init_cdb() which may do GFP_KERNEL allocations.

Remove the in_interrupt() check because all callers are from preemptible
context.

Link: https://lore.kernel.org/r/20201220203638.43615-5-bigeasy@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_alua.c