Skip to contentSkip to conversation

target: Updates for .38-rc5

PATCH New Nicholas A. Bellinger 1 participant 4 messages Feb 9, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover target: Updates for .38-rc5

From: Nicholas Bellinger <[email protected]>

Hi James and Co,

The following three patches should also be included into for-38 mainline from upstream LIO target code in lio-core-2.6.git. These patches are against my scsi-post-merge-2.6.git/for-38-rc5 tree containing the original 24 and 12 part for-38 series here:

git://git.kernel.org/pub/scm/linux/kernel/git/nab/scsi-post-merge-2.6.git for-38-rc5

Please review and let me know if these need to be rebased.

Thanks,

Fubo Chen (1):
target: Fix generated *_drop_nodeacl() handler in tcm_mod_builder.py

Nicholas Bellinger (2):
target: Fix SCF_SCSI_CONTROL_SG_IO_CDB breakage
target: Fix bogus return in transport_add_device_to_core_hba failure
path

 Documentation/target/tcm_mod_builder.py |    1 +
 drivers/target/target_core_transport.c  |   11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.4
#1 lore raw

PATCH 1/3 target: Fix SCF_SCSI_CONTROL_SG_IO_CDB breakage

From: Nicholas Bellinger <[email protected]>

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.

---
 drivers/target/target_core_transport.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/target/target_core_transport.c +5 -1
index 89b4446..77d690b 100644
@@ -4854,6 +4854,8 @@ static int transport_do_se_mem_map(
 
 		return ret;
 	}
+
+	BUG_ON(list_empty(se_mem_list));
 	/*
 	 * This is the normal path for all normal non BIDI and BIDI-COMMAND
 	 * WRITE payloads..  If we need to do BIDI READ passthrough for
@@ -5035,7 +5037,9 @@ transport_map_control_cmd_to_task(struct se_cmd *cmd)
 		struct se_mem *se_mem = NULL, *se_mem_lout = NULL;
 		u32 se_mem_cnt = 0, task_offset = 0;
 
-		BUG_ON(list_empty(cmd->t_task->t_mem_list));
+		if (!list_empty(T_TASK(cmd)->t_mem_list))
+			se_mem = list_entry(T_TASK(cmd)->t_mem_list->next,
+					struct se_mem, se_list);
 
 		ret = transport_do_se_mem_map(dev, task,
 				cmd->t_task->t_mem_list, NULL, se_mem,
Signature · 1 line
1.7.4
#2 lore raw

PATCH 2/3 target: Fix bogus return in transport_add_device_to_core_hba failure path

In reply to Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

This patch removes a bogus conditional+return check within the failure path of transport_add_device_to_core_hba(). This breakage was introduced during the v4 conversion to remove struct se_cmd passthrough ops for INQUIRY / READ_CAPCITY during struct se_device creation and registration process.

---
 drivers/target/target_core_transport.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/target/target_core_transport.c +2 -3
index 77d690b..b107a06 100644
@@ -1621,7 +1621,7 @@ struct se_device *transport_add_device_to_core_hba(
 	const char *inquiry_prod,
 	const char *inquiry_rev)
 {
-	int ret = 0, force_pt;
+	int force_pt;
 	struct se_device  *dev;
 
 	dev = kzalloc(sizeof(struct se_device), GFP_KERNEL);
@@ -1738,9 +1738,8 @@ struct se_device *transport_add_device_to_core_hba(
 	}
 	scsi_dump_inquiry(dev);
 
+	return dev;
 out:
-	if (!ret)
-		return dev;
 	kthread_stop(dev->process_thread);
 
 	spin_lock(&hba->device_lock);
Signature · 1 line
1.7.4
#3 lore raw

PATCH 3/3 target: Fix generated *_drop_nodeacl() handler in tcm_mod_builder.py

In reply to Nicholas A. Bellinger

From: Fubo Chen <[email protected]>

This patch adds the missing core_tpg_del_initiator_node_acl() call required by fabric modules for struct se_node_acl->acl_group context shutdown via

	target_core_fabric_configfs.c:target_fabric_nacl_base_release() ->

		struct target_core_fabric_ops->fabric_drop_nodeacl()

for tcm_mod_builder.py generated $FABRIC_MOD_configfs.c skeleton code.

---
 Documentation/target/tcm_mod_builder.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Documentation/target/tcm_mod_builder.py +1 -0
index 89af6c7..7ef9b84 100755
@@ -289,6 +289,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
 	buf += "{\n"
 	buf += "	struct " + fabric_mod_name + "_nacl *nacl = container_of(se_acl,\n"
 	buf += "				struct " + fabric_mod_name + "_nacl, se_node_acl);\n"
+	buf += "	core_tpg_del_initiator_node_acl(se_acl->se_tpg, se_acl, 1);\n"
 	buf += "	kfree(nacl);\n"
 	buf += "}\n\n"
 
Signature · 1 line
1.7.4