linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] target: Updates for .38-rc5
@ 2011-02-09 22:01 Nicholas A. Bellinger
  2011-02-09 22:01 ` [PATCH 1/3] target: Fix SCF_SCSI_CONTROL_SG_IO_CDB breakage Nicholas A. Bellinger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2011-02-09 22:01 UTC (permalink / raw)
  To: linux-scsi, James Bottomley
  Cc: Christoph Hellwig, Mike Christie, Hannes Reinecke,
	FUJITA Tomonori, Nicholas Bellinger

From: Nicholas Bellinger <nab@linux-iscsi.org>

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,

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>

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(-)

-- 
1.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] target: Fix SCF_SCSI_CONTROL_SG_IO_CDB breakage
  2011-02-09 22:01 [PATCH 0/3] target: Updates for .38-rc5 Nicholas A. Bellinger
@ 2011-02-09 22:01 ` Nicholas A. Bellinger
  2011-02-09 22:01 ` [PATCH 2/3] target: Fix bogus return in transport_add_device_to_core_hba failure path Nicholas A. Bellinger
  2011-02-09 22:01 ` [PATCH 3/3] target: Fix generated *_drop_nodeacl() handler in tcm_mod_builder.py Nicholas A. Bellinger
  2 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2011-02-09 22:01 UTC (permalink / raw)
  To: linux-scsi, James Bottomley
  Cc: Christoph Hellwig, Mike Christie, Hannes Reinecke,
	FUJITA Tomonori, Nicholas Bellinger

From: Nicholas Bellinger <nab@linux-iscsi.org>

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>
---
 drivers/target/target_core_transport.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 89b4446..77d690b 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -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,
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] target: Fix bogus return in transport_add_device_to_core_hba failure path
  2011-02-09 22:01 [PATCH 0/3] target: Updates for .38-rc5 Nicholas A. Bellinger
  2011-02-09 22:01 ` [PATCH 1/3] target: Fix SCF_SCSI_CONTROL_SG_IO_CDB breakage Nicholas A. Bellinger
@ 2011-02-09 22:01 ` Nicholas A. Bellinger
  2011-02-09 22:01 ` [PATCH 3/3] target: Fix generated *_drop_nodeacl() handler in tcm_mod_builder.py Nicholas A. Bellinger
  2 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2011-02-09 22:01 UTC (permalink / raw)
  To: linux-scsi, James Bottomley
  Cc: Christoph Hellwig, Mike Christie, Hannes Reinecke,
	FUJITA Tomonori, Nicholas Bellinger

From: Nicholas Bellinger <nab@linux-iscsi.org>

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.

Reported-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
---
 drivers/target/target_core_transport.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 77d690b..b107a06 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -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);
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] target: Fix generated *_drop_nodeacl() handler in tcm_mod_builder.py
  2011-02-09 22:01 [PATCH 0/3] target: Updates for .38-rc5 Nicholas A. Bellinger
  2011-02-09 22:01 ` [PATCH 1/3] target: Fix SCF_SCSI_CONTROL_SG_IO_CDB breakage Nicholas A. Bellinger
  2011-02-09 22:01 ` [PATCH 2/3] target: Fix bogus return in transport_add_device_to_core_hba failure path Nicholas A. Bellinger
@ 2011-02-09 22:01 ` Nicholas A. Bellinger
  2 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2011-02-09 22:01 UTC (permalink / raw)
  To: linux-scsi, James Bottomley
  Cc: Christoph Hellwig, Mike Christie, Hannes Reinecke,
	FUJITA Tomonori, Fubo Chen, Nicholas A. Bellinger

From: Fubo Chen <fubo.chen@gmail.com>

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.

Signed-off-by: Fubo Chen <fubo.chen@gmail.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
---
 Documentation/target/tcm_mod_builder.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Documentation/target/tcm_mod_builder.py b/Documentation/target/tcm_mod_builder.py
index 89af6c7..7ef9b84 100755
--- a/Documentation/target/tcm_mod_builder.py
+++ b/Documentation/target/tcm_mod_builder.py
@@ -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"
 
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-09 22:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-09 22:01 [PATCH 0/3] target: Updates for .38-rc5 Nicholas A. Bellinger
2011-02-09 22:01 ` [PATCH 1/3] target: Fix SCF_SCSI_CONTROL_SG_IO_CDB breakage Nicholas A. Bellinger
2011-02-09 22:01 ` [PATCH 2/3] target: Fix bogus return in transport_add_device_to_core_hba failure path Nicholas A. Bellinger
2011-02-09 22:01 ` [PATCH 3/3] target: Fix generated *_drop_nodeacl() handler in tcm_mod_builder.py Nicholas A. Bellinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).