[SCSI] target: Fix SCF_SCSI_CONTROL_SG_IO_CDB breakage
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 9 Feb 2011 23:35:04 +0000 (15:35 -0800)
committerJames Bottomley <James.Bottomley@suse.de>
Sat, 12 Feb 2011 18:01:42 +0000 (12:01 -0600)
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>
drivers/target/target_core_transport.c