aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2011-02-09 18:35:04 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-12 13:01:42 -0500
commite63af95888894af6ca4112dc90083d1dff0fec29 (patch)
tree4251ae1e75e8dfe1f9ad4d0eaf1020eeb8e1b518 /drivers/target
parent7c2bf6e925c38b8e3358f5046971b0d6086ddcf8 (diff)
[SCSI] target: Fix SCF_SCSI_CONTROL_SG_IO_CDB breakage
This patch fixes a bug introduced during the v4 control CDB emulation refactoring that broke SCF_SCSI_CONTROL_SG_IO_CDB operation within transport_map_control_cmd_to_task(). It moves the BUG_ON() into transport_do_se_mem_map() after the TRANSPORT(dev)->do_se_mem_map() RAMDISK_DR special case, and adds the proper struct se_mem assignment when !list_empty() for normal non RAMDISK_DR backend device cases. Reported-by: Kai-Thorsten Hambrecht <kai@hambrecht.org> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_transport.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 28b6292ff298..32dc5163b5a0 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -4827,6 +4827,8 @@ static int transport_do_se_mem_map(
4827 4827
4828 return ret; 4828 return ret;
4829 } 4829 }
4830
4831 BUG_ON(list_empty(se_mem_list));
4830 /* 4832 /*
4831 * This is the normal path for all normal non BIDI and BIDI-COMMAND 4833 * This is the normal path for all normal non BIDI and BIDI-COMMAND
4832 * WRITE payloads.. If we need to do BIDI READ passthrough for 4834 * WRITE payloads.. If we need to do BIDI READ passthrough for
@@ -5008,7 +5010,9 @@ transport_map_control_cmd_to_task(struct se_cmd *cmd)
5008 struct se_mem *se_mem = NULL, *se_mem_lout = NULL; 5010 struct se_mem *se_mem = NULL, *se_mem_lout = NULL;
5009 u32 se_mem_cnt = 0, task_offset = 0; 5011 u32 se_mem_cnt = 0, task_offset = 0;
5010 5012
5011 BUG_ON(list_empty(cmd->t_task->t_mem_list)); 5013 if (!list_empty(T_TASK(cmd)->t_mem_list))
5014 se_mem = list_entry(T_TASK(cmd)->t_mem_list->next,
5015 struct se_mem, se_list);
5012 5016
5013 ret = transport_do_se_mem_map(dev, task, 5017 ret = transport_do_se_mem_map(dev, task,
5014 cmd->t_task->t_mem_list, NULL, se_mem, 5018 cmd->t_task->t_mem_list, NULL, se_mem,