linux-stable/drivers/target
Greg Edwards fed564f650 scsi: target: iblock: split T10 PI SGL across command bios
When T10 PI is enabled on a backing device for the iblock backstore, the PI
SGL for the entire command is attached to the first bio only.  This works fine
if the command is covered by a single bio, but can result in ref tag errors in
the client for the other bios in a multi-bio command, e.g.

[   47.631236] sda: ref tag error at location 2048 (rcvd 0)
[   47.637658] sda: ref tag error at location 4096 (rcvd 0)
[   47.644228] sda: ref tag error at location 6144 (rcvd 0)

The command will be split into multiple bios if the number of data SG elements
exceeds BIO_MAX_PAGES (see iblock_get_bio()).

The bios may later be split again in the block layer on the host after
iblock_submit_bios(), depending on the queue limits of the backing device.
The block and SCSI layers will pass through the whole PI SGL down to the LLDD
however that first bio is split up, but the LLDD may only use the portion that
corresponds to the data length (depends on the LLDD, tested with scsi_debug).

Split the PI SGL across the bios in the command, so each bio's
bio_integrity_payload contains the protection information for the data in the
bio.  Use an sg_mapping_iter to keep track of where we are in PI SGL, so we
know where to start with the next bio.

Signed-off-by: Greg Edwards <gedwards@ddn.com>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-09-20 22:27:00 -04:00
..
iscsi scsi: iscsi: target: fix spelling mistake "entires" -> "entries" 2018-09-17 02:32:29 -04:00
loopback SCSI misc on 20180815 2018-08-15 22:06:26 -07:00
sbp scsi: target: srp, vscsi, sbp, qla: use target_remove_session 2018-08-02 15:29:31 -04:00
tcm_fc scsi: tcm_fc: use target_remove_session 2018-08-02 15:29:31 -04:00
Kconfig target: don't depend on SCSI 2018-08-02 15:19:49 -06:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
target_core_alua.c target: fix ALUA state file path truncation 2017-11-04 15:00:30 -07:00
target_core_alua.h Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2017-11-24 19:19:20 -10:00
target_core_configfs.c scsi: target: add helper to check if dev is configured 2018-07-30 23:17:53 -04:00
target_core_device.c scsi: target: add helper to check if dev is configured 2018-07-30 23:17:53 -04:00
target_core_fabric_configfs.c scsi: target: add helper to check if dev is configured 2018-07-30 23:17:53 -04:00
target_core_fabric_lib.c target-core: don't use "const char*" for a buffer that is written to 2018-01-12 15:07:09 -08:00
target_core_file.c scsi: target: target/file: Add support of direct and async I/O 2018-05-14 22:40:08 -04:00
target_core_file.h scsi: target: target/file: Add support of direct and async I/O 2018-05-14 22:40:08 -04:00
target_core_hba.c
target_core_iblock.c scsi: target: iblock: split T10 PI SGL across command bios 2018-09-20 22:27:00 -04:00
target_core_iblock.h target: convert to bioset_init()/mempool_init() 2018-05-30 15:33:32 -06:00
target_core_internal.h scsi: target: Fold core_tmr_handle_tas_abort() into transport_cmd_finish_abort() 2018-07-02 16:44:31 -04:00
target_core_pr.c scsi: target: Fix truncated PR-in ReadKeys response 2018-06-19 21:36:37 -04:00
target_core_pr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
target_core_pscsi.c SCSI misc on 20180610 2018-06-10 13:01:12 -07:00
target_core_pscsi.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
target_core_rd.c target: break up free_device callback 2017-07-06 23:11:37 -07:00
target_core_rd.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
target_core_sbc.c scsi: target: Use config_item_name() instead of open-coding it 2018-07-02 16:44:30 -04:00
target_core_spc.c target: Fix cmd size for PR-OUT in passthrough_parse_cdb 2017-07-09 20:58:49 -07:00
target_core_stat.c target: make config_item_type const 2017-10-19 16:15:17 +02:00
target_core_tmr.c scsi: target: Fold core_tmr_handle_tas_abort() into transport_cmd_finish_abort() 2018-07-02 16:44:31 -04:00
target_core_tpg.c target: Fix node_acl demo-mode + uncached dynamic shutdown regression 2017-08-09 20:55:19 -07:00
target_core_transport.c scsi: target: add session removal function 2018-08-02 15:29:31 -04:00
target_core_ua.c scsi: target: Remove se_dev_entry.ua_count 2018-07-02 16:44:32 -04:00
target_core_ua.h scsi: target: Fix handling of removed LUNs 2018-07-02 16:44:32 -04:00
target_core_user.c SCSI misc on 20180815 2018-08-15 22:06:26 -07:00
target_core_xcopy.c scsi: target: Introduce transport_init_session() 2018-07-02 16:44:31 -04:00
target_core_xcopy.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00