linux/drivers/target
Nicholas Bellinger c3c74c7a33 target: Fix task SGL chaining breakage with transport_allocate_data_tasks
This patch fixes two bugs associated with transport_do_task_sg_chain()
operation where transport_allocate_data_tasks() was incorrectly setting
task_padded_sg for all tasks, and causing bogus task->task_sg_nents
assignments + OOPsen with fabrics depending upon this code.  The first bit
here adds a task_sg_nents_padded check in transport_allocate_data_tasks()
to include an extra SGL vector when necessary for tasks that expect to
be linked using sg_chain().

The second change involves making transport_do_task_sg_chain() properly
account for the extra SGL vector when task->task_padded_sg is set for
the non trailing ->task_sg or single ->task_sg allocations.  Note this
patch also removes the BUG_ON(!task->task_padded_sg) check within
transport_do_task_sg_chain() as we expect this to happen normally
with the updated logic in transport_allocate_data_tasks(), along with
being bogus for CONTROL_SG_IO_CDB type payloads.

So far this bugfix has been tested with tcm_qla2xxx and iblock backends
in (task_count > 1)( and (task_count == 1) operation.

Reported-by: Kiran Patil <kiran.patil@intel.com>
Cc: Kiran Patil <kiran.patil@intel.com>
Cc: Andy Grover <agrover@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-08-22 19:26:28 +00:00
..
iscsi iscsi-target: forever loop bug in iscsit_attach_ooo_cmdsn() 2011-08-22 19:26:19 +00:00
loopback target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
tcm_fc Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2011-08-03 15:12:09 -10:00
Kconfig iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
Makefile iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
target_core_alua.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_alua.h
target_core_cdb.c target: Remove duplicate task completions in transport_emulate_control_cdb 2011-08-22 19:26:23 +00:00
target_core_configfs.c target: fix typo Assoication -> Association 2011-07-22 09:37:49 +00:00
target_core_device.c target: Fix task count > 1 handling breakage and use max_sector page alignment 2011-08-22 19:26:27 +00:00
target_core_fabric_configfs.c target: Use ERR_CAST inlined function 2011-08-22 19:26:15 +00:00
target_core_fabric_lib.c target: remove custom hex2bin() implementation 2011-07-22 09:37:49 +00:00
target_core_file.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_file.h target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_hba.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_hba.h
target_core_iblock.c target: ->map_task_SG conversion to ->map_control_SG and ->map_data_SG 2011-07-22 09:37:48 +00:00
target_core_iblock.h target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_pr.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_pr.h target: Core cleanups from AGrover (round 1) 2011-07-22 09:37:43 +00:00
target_core_pscsi.c target: ->map_task_SG conversion to ->map_control_SG and ->map_data_SG 2011-07-22 09:37:48 +00:00
target_core_pscsi.h target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_rd.c target: Convert target_core_rd.c to use use BUG_ON 2011-08-22 19:26:17 +00:00
target_core_rd.h target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_scdb.c target: Pass 2nd param of transport_split_cdb by value 2011-07-22 09:37:48 +00:00
target_core_scdb.h target: Pass 2nd param of transport_split_cdb by value 2011-07-22 09:37:48 +00:00
target_core_stat.c target: Core cleanups from AGrover (round 1) 2011-07-22 09:37:43 +00:00
target_core_stat.h [SCSI] target: add initial statistics 2011-03-23 11:36:50 -05:00
target_core_tmr.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_tpg.c target: Make standard INQUIRY return 'not connected' for tpg_virt_lun0 2011-08-22 19:25:35 +00:00
target_core_transport.c target: Fix task SGL chaining breakage with transport_allocate_data_tasks 2011-08-22 19:26:28 +00:00
target_core_ua.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_ua.h