linux/drivers/target
Akinobu Mita c836777830 target/file: Fix SG table for prot_buf initialization
In fd_do_prot_rw(), it allocates prot_buf which is used to copy from
se_cmd->t_prot_sg by sbc_dif_copy_prot().  The SG table for prot_buf
is also initialized by allocating 'se_cmd->t_prot_nents' entries of
scatterlist and setting the data length of each entry to PAGE_SIZE
at most.

However if se_cmd->t_prot_sg contains a clustered entry (i.e.
sg->length > PAGE_SIZE), the SG table for prot_buf can't be
initialized correctly and sbc_dif_copy_prot() can't copy to prot_buf.
(This actually happened with TCM loopback fabric module)

As prot_buf is allocated by kzalloc() and it's physically contiguous,
we only need a single scatterlist entry.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
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: <stable@vger.kernel.org> # v3.14+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2015-04-15 22:47:25 -07:00
..
iscsi target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
loopback target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
sbp target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
tcm_fc target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
Kconfig target: Add a user-passthrough backstore 2014-10-03 11:15:20 -07:00
Makefile target: Add a user-passthrough backstore 2014-10-03 11:15:20 -07:00
target_core_alua.c scsi: rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 2014-11-24 20:01:40 +01:00
target_core_alua.h target_core_alua: Referrals configfs integration 2014-01-09 21:48:35 -08:00
target_core_configfs.c target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
target_core_device.c target: Drop left-over fabric_max_sectors attribute 2015-01-09 15:22:05 -08:00
target_core_fabric_configfs.c target: simplify the target template registration API 2015-04-14 12:28:41 -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/file: Fix SG table for prot_buf initialization 2015-04-15 22:47:25 -07:00
target_core_file.h Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2014-01-31 15:31:23 -08: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/iblock: Add checks for backend DIF emulation 2015-04-07 23:27:44 -07:00
target_core_iblock.h
target_core_internal.h target: move external declarations to a headers 2015-03-26 14:51:53 -07:00
target_core_pr.c target: Fix two sparse warnings 2015-04-14 12:37:38 -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 SCSI for-linus on 20141220 2014-12-20 13:42:57 -08:00
target_core_pscsi.h
target_core_rd.c target/rd: Don't pass incomplete scatterlist entries to sbc_dif_verify_* 2015-04-14 12:37:42 -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/sbc: Update sbc_dif_generate pr_debug output 2015-04-15 22:47:19 -07:00
target_core_spc.c target: Update SPC/SBC emulation for sess_prot_type 2015-04-07 23:26:09 -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: Make core_tmr_abort_task() skip TMFs 2015-04-15 22:47:21 -07:00
target_core_tpg.c target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
target_core_transport.c target: Ensure sess_prot_type is saved across session restart 2015-04-15 22:46:30 -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: add missing __user annotations 2015-03-26 14:53:17 -07:00
target_core_xcopy.c target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
target_core_xcopy.h target: Add support for EXTENDED_COPY copy offload emulation 2013-09-10 16:48:43 -07:00