Himanshu Madhani | 29 May 22:22 2015

Re: Targetcli issue with 4.1.0-rc5+ and qla2xxx

adding mailing list

From:  Himanshu Madhani <himanshu.madhani <at> qlogic.com>
Date:  Friday, May 29, 2015 at 11:59 AM
To:  "Nicholas A. Bellinger" <nab <at> linux-iscsi.org>
Cc:  Quinn Tran <quinn.tran <at> qlogic.com>, Arun Easi <arun.easi <at> qlogic.com>,
Giridhar Malavali <giridhar.malavali <at> qlogic.com>
Subject:  Targetcli issue with 4.1.0-rc5+ and qla2xxx

>Hi Nicholas, 
>
>I just updated my kernel to 4.1.0-rc5+ and I am seeing problem to create
>ram disk target with latest kernel.
>
>/> cd backstores/ramdisk
>/backstores/ramdisk> create rm_lun0 1G
>Created ramdisk rm_lun0 with size 1G.
>/backstores/ramdisk> ls
>o- ramdisk 
>..........................................................................
>................. [Storage Objects: 1]
>  o- rm_lun0 
>..........................................................................
>............. [(1.0GiB) deactivated]
>/backstores/ramdisk> cd ..
>/backstores> cd ..
>/> cd qla2xxx
>
>/qla2xxx> create 21:00:00:24:ff:78:46:b4
>Cannot change enable state: [Errno 19] No such device
(Continue reading)

Bart Van Assche | 26 May 15:32 2015

[PATCH] target: Remove set-but-not-used variables

Noticed this by building the target code with W=1.

Signed-off-by: Bart Van Assche <bart.vanassche <at> sandisk.com>
---
 drivers/target/target_core_pr.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
index b991784..bedf1bf 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
 <at>  <at>  -1414,8 +1414,7  <at>  <at>  static void core_scsi3_nodeacl_undepend_item(struct se_node_acl *nacl)
 static int core_scsi3_lunacl_depend_item(struct se_dev_entry *se_deve)
 {
 	struct se_lun_acl *lun_acl;
-	struct se_node_acl *nacl;
-	struct se_portal_group *tpg;
+
 	/*
 	 * For nacl->dynamic_node_acl=1
 	 */
 <at>  <at>  -1423,17 +1422,13  <at>  <at>  static int core_scsi3_lunacl_depend_item(struct se_dev_entry *se_deve)
 	if (!lun_acl)
 		return 0;

-	nacl = lun_acl->se_lun_nacl;
-	tpg = nacl->se_tpg;
-
 	return target_depend_item(&lun_acl->se_lun_group.cg_item);
 }
(Continue reading)

Bart Van Assche | 26 May 15:06 2015

[PATCH] iscsi-target: Fix indentation

Avoid that smatch complains about inconsistent indentation.

Signed-off-by: Bart Van Assche <bart.vanassche <at> sandisk.com>
---
 drivers/target/iscsi/iscsi_target_erl1.c       | 7 +++----
 drivers/target/iscsi/iscsi_target_parameters.c | 2 +-
 drivers/target/iscsi/iscsi_target_tmr.c        | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c
index 2e561de..9214c9d 100644
--- a/drivers/target/iscsi/iscsi_target_erl1.c
+++ b/drivers/target/iscsi/iscsi_target_erl1.c
 <at>  <at>  -160,8 +160,7  <at>  <at>  static int iscsit_handle_r2t_snack(
 			" protocol error.\n", cmd->init_task_tag, begrun,
 			(begrun + runlength), cmd->acked_data_sn);

-			return iscsit_reject_cmd(cmd,
-					ISCSI_REASON_PROTOCOL_ERROR, buf);
+		return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, buf);
 	}

 	if (runlength) {
 <at>  <at>  -628,8 +627,8  <at>  <at>  int iscsit_dataout_datapduinorder_no_fbit(
 			if (cmd->pdu_list[i].seq_no == pdu->seq_no) {
 				if (!first_pdu)
 					first_pdu = &cmd->pdu_list[i];
-				 xfer_len += cmd->pdu_list[i].length;
-				 pdu_count++;
+				xfer_len += cmd->pdu_list[i].length;
(Continue reading)

Bart Van Assche | 26 May 15:05 2015

[PATCH] iscsi-target: Remove unreachable code

Detected by smatch.

Signed-off-by: Bart Van Assche <bart.vanassche <at> sandisk.com>
---
 drivers/target/iscsi/iscsi_target.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index b2d46ef..886b743 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
 <at>  <at>  -4447,9 +4447,6  <at>  <at>  int iscsit_close_connection(

 		return 0;
 	}
-	spin_unlock_bh(&sess->conn_lock);
-
-	return 0;
 }

 int iscsit_close_session(struct iscsi_session *sess)
--

-- 
2.1.4

Bart Van Assche | 26 May 13:07 2015

[PATCH 0/4] libfc patches for kernel v4.2

Hello Vasu,

Please consider the following four patches for Linux kernel v4.2. I came 
up with these patches while retesting the libfc code against the LIO 
FCoE target driver:

0001-libfc-Fix-a-typo-in-a-source-code-comment.patch
0002-libfc-Initialize-fc_exch.resp_task.patch
0003-libfc-Fix-fc_exch_recv_req-error-path.patch
0004-libfc-Fix-fc_fcp_cleanup_each_cmd.patch

Thanks,

Bart.
Nicholas A. Bellinger | 26 May 08:40 2015

[PATCH-v3 00/10] target: se_node_acl + se_lun RCU conversions

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

Hi all,

Here is -v3 series for converting LIO target se_node_acl + se_lun
mapping tables from fixed size arrays to dynamic RCU hlist_heads.

This turns fast-path I/O into a lock-less RCU reader using existing
percpu based se_lun->lun_ref logic, and converts the RCU updater
path to allow for an arbitrary number of LUNs for both types of
mappings within target-core.

As per this afternoon's email thread, the se_dev_entry->pr_comp
has been left in place for se_dev_entry shutdown within patch #1.
This completion is still required in order to prevent the configfs
se_lun_acl->se_lun_group from being removed from out below the
core_scsi3_lunacl_depend_item() caller during the special-case PR
ALL_TG_PT=1 registration handling.

The changes based on -v2 series feedback from HCH & Co include:

  - Remove unused se_dev_entry->se_node_acl
  - Drop unnecessary check in lunacl_undepend_item
  - target: Drop bogus mutex_unlock in core_disable_device_list_for_node
  - Drop left-over se_lun->lun_status
  - target: Rename ->pr_regs to ->deve_flags + add bit definitions
  - target: Convert se_dev_entry stats to atomic_long_t
  - Avoid unnecessary PR target_nacl_find_deve() lookup in registration
  - Add se_lun->lun_index for RCU dev->dev_index usage in stat.c
  - Add various rcu_dereference and lockless_dereference RCU notation
(Continue reading)

Nicholas A. Bellinger | 26 May 08:25 2015

[PATCH-v3 00/10] target: se_node_acl + se_lun RCU conversions

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

Hi all,

Here is -v3 series for converting LIO target se_node_acl + se_lun
mapping tables from fixed size arrays to dynamic RCU hlist_heads.

This turns fast-path I/O into a lock-less RCU reader using existing
percpu based se_lun->lun_ref logic, and converts the RCU updater
path to allow for an arbitrary number of LUNs for both types of
mappings within target-core.

As per this afternoon's email thread, the se_dev_entry->pr_comp
has been left in place for se_dev_entry shutdown within patch #1.
This completion is still required in order to prevent the configfs
se_lun_acl->se_lun_group from being removed from out below the
core_scsi3_lunacl_depend_item() caller during the special-case PR
ALL_TG_PT=1 registration handling.

The changes based on -v2 series feedback from HCH & Co include:

  - Remove unused se_dev_entry->se_node_acl
  - Drop unnecessary check in lunacl_undepend_item
  - target: Drop bogus mutex_unlock in core_disable_device_list_for_node
  - Drop left-over se_lun->lun_status
  - target: Rename ->pr_regs to ->deve_flags + add bit definitions
  - target: Convert se_dev_entry stats to atomic_long_t
  - Avoid unnecessary PR target_nacl_find_deve() lookup in registration
  - Add se_lun->lun_index for RCU dev->dev_index usage in stat.c
  - Add various rcu_dereference and lockless_dereference RCU notation
(Continue reading)

Andy Grover | 22 May 23:07 2015
Picon

[PATCH] target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST

See https://bugzilla.redhat.com/show_bug.cgi?id=1025672

We need to put() the reference to the scsi host that we got in
pscsi_configure_device(). In VIRTUAL_HOST mode it is associated with
the dev_virt, not the hba_virt.

Signed-off-by: Andy Grover <agrover <at> redhat.com>
---
 drivers/target/target_core_pscsi.c | 3 +++
 drivers/target/target_core_pscsi.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
index 5bc458e..7ce0445 100644
--- a/drivers/target/target_core_pscsi.c
+++ b/drivers/target/target_core_pscsi.c
 <at>  <at>  -519,6 +519,7  <at>  <at>  static int pscsi_configure_device(struct se_device *dev)
 					" pdv_host_id: %d\n", pdv->pdv_host_id);
 				return -EINVAL;
 			}
+			pdv->pdv_lld_host = sh;
 		}
 	} else {
 		if (phv->phv_mode == PHV_VIRTUAL_HOST_ID) {
 <at>  <at>  -601,6 +602,8  <at>  <at>  static void pscsi_free_device(struct se_device *dev)
 		if ((phv->phv_mode == PHV_LLD_SCSI_HOST_NO) &&
 		    (phv->phv_lld_host != NULL))
 			scsi_host_put(phv->phv_lld_host);
+		else if (pdv->pdv_lld_host)
+			scsi_host_put(pdv->pdv_lld_host);
(Continue reading)

Nicholas A. Bellinger | 22 May 09:57 2015

[RFC 0/2] target: Add TFO->complete_irq queue_work bypass

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

Hi HCH & Co,

Here is RFC code for adding target_core_fabric_ops->complete_irq
bypass that allows fabrics to invoke response callbacks directly
from target_complete_cmd() IRQ context.

It breaks up existing target_complete_ok_work() code into three
pieces:

  - transport_complete_task_attr()
  - target_complete_ok_pre()
  - target_complete_irq()

and allows target_complete_irq() be called directly from IRQ context
if no special case se_cmd handling requirements exist.

The three cases that trigger queue_work() process context are:

  - non GOOD status
  - ORDERED task sync
  - non NULL se_cmd->transport_complete_callback()

It also includes converting target_restart_delayed_cmds() to use
llist_head, and checking within transport_complete_task_attr() to
determine if dev_ordered_sync is non zero, ahead of doing the
llist_del_all() -> cmpxchg of outstanding ordered tags.

This allows loopback LLD code to bypass the extra queue_work, and
(Continue reading)

Nicholas A. Bellinger | 22 May 08:11 2015

[PATCH-v2 0/9] target: se_node_acl + se_lun RCU conversions

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

Hi all,

Here is -v2 series for converting LIO target se_node_acl + se_lun
mapping tables from fixed size arrays to dynamic RCU hlist_heads.

This turns fast-path I/O into a lock-less RCU reader using existing
percpu based se_lun->lun_ref logic, and converts the RCU updater
path to allow for an arbitrary number of LUNs for both types of
mappings within target-core.

This series also squashes a number of previous se_node_acl RCU
related changes into a single commit (#1) for easier review,
and to avoid potential bisect issues.

There have been a number of changes since -v1, including:

  - Mirror port->sep_rtpi in lun->lun_rtpi for RCU
  - Drop unnecessary synchronize_rcu() usage
  - Convert call_rcu() to kfree_rcu() usage
  - Move hlist_del_rcu head of rcu_assign_pointer in se_dev_entry
  - Drop unnecessary lookup deve in target_fabric_mappedlun_unlink()
  - Add target_lun_is_rdonly helper
  - Acquire lun_entry_mutex during core_disable_device_list_for_node
  - Drop TRANSPORT_LUNFLAGS_*_ACCESS usage
  - Pass se_dev_entry directly to core_disable_device_list_for_node
  - Convert sbp-target se_lun usage to use ->login_lun
  - Fix se_session dereference in spc_emulate_report_luns 
  - Fix testing for NULL instead of IS_ERR in fabric_make_lun()
(Continue reading)

Akinobu Mita | 22 May 01:41 2015
Picon

[PATCH] target: fix operator precedence bug

CMD_T_SENT flag on se_cmd->transport_state is considered to be cleared
when the command is failed or delayed.  But it is not cleared in some
places due to the lack of parenthesis.

Signed-off-by: Akinobu Mita <akinobu.mita <at> gmail.com>
Cc: Nicholas Bellinger <nab <at> linux-iscsi.org>
Cc: target-devel <at> vger.kernel.org
---
 drivers/target/target_core_transport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 1947e67..446affb 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
 <at>  <at>  -1771,7 +1771,7  <at>  <at>  static int target_write_prot_action(struct se_cmd *cmd)
 					     sectors, 0, cmd->t_prot_sg, 0);
 		if (unlikely(cmd->pi_err)) {
 			spin_lock_irq(&cmd->t_state_lock);
-			cmd->transport_state &= ~CMD_T_BUSY|CMD_T_SENT;
+			cmd->transport_state &= ~(CMD_T_BUSY|CMD_T_SENT);
 			spin_unlock_irq(&cmd->t_state_lock);
 			transport_generic_request_failure(cmd, cmd->pi_err);
 			return -1;
 <at>  <at>  -1869,7 +1869,7  <at>  <at>  void target_execute_cmd(struct se_cmd *cmd)

 	if (target_handle_task_attr(cmd)) {
 		spin_lock_irq(&cmd->t_state_lock);
-		cmd->transport_state &= ~CMD_T_BUSY|CMD_T_SENT;
+		cmd->transport_state &= ~(CMD_T_BUSY|CMD_T_SENT);
(Continue reading)


Gmane