linux-stable/drivers/target
David Jeffery 8be70a842f scsi: target: pscsi: Set SCF_TREAT_READ_AS_NORMAL flag only if there is valid data
With tape devices, the SCF_TREAT_READ_AS_NORMAL flag is used by the target
subsystem to mark commands which have both data to return as well as sense
data. But with pscsi, SCF_TREAT_READ_AS_NORMAL can be set even if there is
no data to return. The SCF_TREAT_READ_AS_NORMAL flag causes the target core
to call iscsit data-in callbacks even if there is no data, which iscsit
does not support. This results in iscsit going into an error state
requiring recovery and being unable to complete the command to the
initiator.

This issue can be resolved by fixing pscsi to only set
SCF_TREAT_READ_AS_NORMAL if there is valid data to return alongside the
sense data.

Link: https://lore.kernel.org/r/20220427183250.291881-1-djeffery@redhat.com
Fixes: bd81372065 ("scsi: target: transport should handle st FM/EOM/ILI reads")
Reported-by: Scott Hamilton <scott.hamilton@atos.net>
Tested-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2022-04-27 22:40:09 -04:00
..
iscsi scsi: target: Add iscsi/cpus_allowed_list in configfs 2022-03-14 23:40:36 -04:00
loopback scsi: target: tcm_loop: Call scsi_done() directly 2021-10-16 21:31:43 -04:00
sbp scsi: target: sbp: Replace enable attr with ops.enable 2021-10-04 23:27:38 -04:00
tcm_fc
Kconfig scsi: core: Rename CONFIG_BLK_SCSI_REQUEST to CONFIG_SCSI_COMMON 2021-07-28 22:24:27 -04:00
Makefile
target_core_alua.c scsi: target: Perform ALUA group changes in one step 2021-10-18 22:38:36 -04:00
target_core_alua.h
target_core_configfs.c Merge branch '5.15/scsi-fixes' into 5.16/scsi-staging 2021-10-12 11:58:12 -04:00
target_core_device.c scsi: target: Fix ordered tag handling 2021-10-18 22:38:35 -04:00
target_core_fabric_configfs.c scsi: target: configfs: Delete unnecessary checks for NULL 2021-11-18 23:07:02 -05:00
target_core_fabric_lib.c
target_core_file.c fs: get rid of the res2 iocb->ki_complete argument 2021-10-25 10:36:24 -06:00
target_core_file.h
target_core_hba.c
target_core_iblock.c block: pass a block_device and opf to bio_alloc 2022-02-02 07:49:59 -07:00
target_core_iblock.h
target_core_internal.h scsi: target: Fix ordered tag handling 2021-10-18 22:38:35 -04:00
target_core_pr.c scsi: target: Fix spelling mistake "CONFLIFT" -> "CONFLICT" 2021-09-22 00:17:29 -04:00
target_core_pr.h
target_core_pscsi.c scsi: target: pscsi: Set SCF_TREAT_READ_AS_NORMAL flag only if there is valid data 2022-04-27 22:40:09 -04:00
target_core_pscsi.h scsi: target: pscsi: Remove struct pscsi_plugin_task 2022-03-01 22:21:49 -05:00
target_core_rd.c
target_core_rd.h
target_core_sbc.c scsi: target: Fix protect handling in WRITE SAME(32) 2021-07-18 21:27:42 -04:00
target_core_spc.c scsi: target: core: Use RCU helpers for INQUIRY t10_alua_tg_pt_gp 2021-11-18 23:06:55 -05:00
target_core_stat.c
target_core_tmr.c scsi: target: core: Remove from tmr_list during LUN unlink 2021-10-26 23:15:23 -04:00
target_core_tpg.c
target_core_transport.c scsi: target: core: Remove from tmr_list during LUN unlink 2021-10-26 23:15:23 -04:00
target_core_ua.c
target_core_ua.h
target_core_user.c scsi: target: tcmu: Fix possible page UAF 2022-03-29 23:07:56 -04:00
target_core_xcopy.c scsi: target: Remove unused function arguments 2021-09-14 23:41:24 -04:00
target_core_xcopy.h