linux/include/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
configfs_macros.h doc: fix broken references 2011-09-27 18:08:04 +02:00
target_core_backend.h target: Merge sbc_verify_dif_read|write 2015-05-30 22:41:41 -07:00
target_core_backend_configfs.h target: Drop left-over fabric_max_sectors attribute 2015-01-09 15:22:05 -08:00
target_core_base.h target: ensure se_cmd->t_prot_sg is allocated when required 2015-05-30 22:42:24 -07:00
target_core_configfs.h target: Fix se_tpg_tfo->tf_subsys regression + remove tf_subsystem 2015-05-30 18:04:20 -07:00
target_core_fabric.h target: move node ACL allocation to core code 2015-05-30 22:42:23 -07:00
target_core_fabric_configfs.h target: Add target_show_dynamic_sessions attribute helper 2015-03-06 21:24:53 -08:00