linux/drivers/target
Akinobu Mita 5835812f13 target: ensure se_cmd->t_prot_sg is allocated when required
Even if the device backend is initialized with protection info is
enabled, some requests don't have the protection info attached for
WRITE SAME command issued by block device helpers, WRITE command with
WRPROTECT=0 by SG_IO ioctl, etc.

So when TCM loopback fabric module is used, se_cmd->t_prot_sg is NULL
for these requests and performing WRITE_INSERT of PI using software
emulation by sbc_dif_generate() causes kernel crash.

To fix this, introduce SCF_PASSTHROUGH_PROT_SG_TO_MEM_NOALLOC for
se_cmd_flags, which is used to determine that se_cmd->t_prot_sg needs
to be allocated or use pre-allocated protection information by scsi
mid-layer.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: target-devel@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2015-05-30 22:42:24 -07:00
..
iscsi target: move node ACL allocation to core code 2015-05-30 22:42:23 -07:00
loopback target: move node ACL allocation to core code 2015-05-30 22:42:23 -07:00
sbp target: move node ACL allocation to core code 2015-05-30 22:42:23 -07:00
tcm_fc target: move node ACL allocation to core code 2015-05-30 22:42:23 -07:00
Kconfig target: Put TCMU under a new config option 2015-04-19 22:41:12 -07:00
Makefile target: Put TCMU under a new config option 2015-04-19 22:41:12 -07:00
target_core_alua.c target: Use a PASSTHROUGH flag instead of transport_types 2015-05-30 19:58:11 -07:00
target_core_alua.h target_core_alua: Referrals configfs integration 2014-01-09 21:48:35 -08:00
target_core_configfs.c target: move node ACL allocation to core code 2015-05-30 22:42:23 -07:00
target_core_device.c target: fix DPO and FUA bit checks 2015-05-30 22:41:44 -07:00
target_core_fabric_configfs.c target: refactor init/drop_nodeacl methods 2015-05-30 22:41:51 -07:00
target_core_fabric_lib.c target: fix pr_out length in iscsi_parse_pr_out_transport_id 2014-09-17 15:17:35 -07:00
target_core_file.c target: fix DPO and FUA bit checks 2015-05-30 22:41:44 -07:00
target_core_file.h target/file: Remove fd_prot bounce buffer 2015-05-30 22:41:42 -07:00
target_core_hba.c target: Move dev_cit to struct se_subsystem_api 2014-12-01 21:35:22 -08:00
target_core_iblock.c target: Use a PASSTHROUGH flag instead of transport_types 2015-05-30 19:58:11 -07:00
target_core_iblock.h target: kill struct se_subsystem_dev 2012-11-06 20:55:43 -08:00
target_core_internal.h target: refactor init/drop_nodeacl methods 2015-05-30 22:41:51 -07:00
target_core_pr.c target: Use a PASSTHROUGH flag instead of transport_types 2015-05-30 19:58:11 -07:00
target_core_pr.h target: Fix APTPL metadata handling for dynamic MappedLUNs 2014-10-04 05:40:19 +00:00
target_core_pscsi.c target: Use a PASSTHROUGH flag instead of transport_types 2015-05-30 19:58:11 -07:00
target_core_pscsi.h target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST 2015-05-30 19:11:02 -07:00
target_core_rd.c target: Merge sbc_verify_dif_read|write 2015-05-30 22:41:41 -07:00
target_core_rd.h target/rd: Add support for protection SGL setup + release 2014-01-19 02:22:05 +00:00
target_core_sbc.c target: Fix inconsistent address passed to kunmap_atomic() in sbc_dif_copy_prot() 2015-05-30 22:42:23 -07:00
target_core_spc.c target: fix DPO and FUA bit checks 2015-05-30 22:41:44 -07:00
target_core_stat.c target: Convert se_device statistics to atomic_long_t 2013-11-13 18:34:55 -08:00
target_core_tmr.c target: Remove first argument of target_{get,put}_sess_cmd() 2015-05-30 22:41:47 -07:00
target_core_tpg.c target: move node ACL allocation to core code 2015-05-30 22:42:23 -07:00
target_core_transport.c target: ensure se_cmd->t_prot_sg is allocated when required 2015-05-30 22:42:24 -07:00
target_core_ua.c target: encapsulate smp_mb__after_atomic() 2014-10-01 14:39:06 -07:00
target_core_ua.h target: target_core_ua_h: Add #define of include guard 2014-09-15 14:27:43 -07:00
target_core_user.c target/user: Add support for bidirectional commands 2015-05-30 22:41:47 -07:00
target_core_xcopy.c target: Fix se_tpg_tfo->tf_subsys regression + remove tf_subsystem 2015-05-30 18:04:20 -07:00
target_core_xcopy.h target: Add support for EXTENDED_COPY copy offload emulation 2013-09-10 16:48:43 -07:00