Andy Grover | 15 Apr 19:44 2014

Re: targetctl restore and OSError: [Errno 22] Invalid argument

On 04/14/2014 06:05 AM, Krzysztof Chojnowski wrote:
> Hi,
> I'm testing targetcli-fb on my Archlinux box and restore functionality
> is failing with following:
> # /usr/bin/targetctl restore
> OSError: [Errno 22] Invalid argument
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):
>    File "/usr/lib/python3.4/site-packages/rtslib/", line 140, in
> set_attribute
>      fwrite(path, "%s" % str(value))
>    File "/usr/lib/python3.4/site-packages/rtslib/", line 67, in
> fwrite
>      file_fd.write(str(string))
> OSError: [Errno 22] Invalid argument
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):
>    File "/usr/bin/targetctl", line 87, in <module>
>      main()
>    File "/usr/bin/targetctl", line 84, in main
>      funcs[sys.argv[1]](savefile)
>    File "/usr/bin/targetctl", line 47, in restore
>      errors = RTSRoot().restore_from_file(restore_file=from_file)
>    File "/usr/lib/python3.4/site-packages/rtslib/", line 260, in
(Continue reading)

Jun Wu | 15 Apr 18:15 2014

tcm_fc crash


We are working on a cluster file system using fcoe vn2vn. Multiple
initiators can see the same set of target hard drives exported by
targetcli tcm_fc. When the initiators run IO to these target hard
drives at the same time, target system crashes no matter using iblock
backstore or pscsi backstore. See the following dump.

crash> bt
PID: 318    TASK: ffff880c1a05aee0  CPU: 5   COMMAND: "kworker/5:1"
 #0 [ffff880c1a895a48] machine_kexec at ffffffff810485e2
 #1 [ffff880c1a895a98] crash_kexec at ffffffff810d09d3
 #2 [ffff880c1a895b60] oops_end at ffffffff816f0c98
 #3 [ffff880c1a895b88] die at ffffffff8101616b
 #4 [ffff880c1a895bb8] do_trap at ffffffff816f04b0
 #5 [ffff880c1a895c08] do_invalid_op at ffffffff810134a8
 #6 [ffff880c1a895cb0] invalid_op at ffffffff816f9c1e
    [exception RIP: ft_queue_data_in+1386]
    RIP: ffffffffa0641eda  RSP: ffff880c1a895d68  RFLAGS: 00010246
    RAX: 0000000000001000  RBX: ffff880c17a6dc10  RCX: 0000000000000002
    RDX: 0000000000000000  RSI: ffff880c1afa36d8  RDI: 0000000000000000
    RBP: ffff880c1a895df8   R8: ffff880c1667e45c   R9: dfcf2970a166dd90
    R10: dfcf2970a166dd90  R11: 0000000000000000  R12: ffff880c17a6dc10
    R13: ffff880c3fc33e00  R14: 0000000000001000  R15: 0000000000000140
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
 #7 [ffff880c1a895d60] ft_queue_data_in at ffffffffa06419c7 [tcm_fc]
 #8 [ffff880c1a895e00] target_complete_ok_work at ffffffffa04ded21

(Continue reading)

Lord Cheeseburger | 15 Apr 17:10 2014

targetcli doesn't see fc hba

targetcli doesnt list my fiber channel controller, so I'm unable to
create targets on it.  Relevant information below.

QLogic QLE2462
CentOS release 6.5 (Final)

[root <at> target lib]# lspci | grep -i qlogic
04:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to
PCI Express HBA (rev 03)
04:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to
PCI Express HBA (rev 03)

[root <at> target qla2xxx]# cat version

[root <at> target modprobe.d]# cat qla2xxx.conf
#allow target mode
options qla2xxx qlini_mode=disabled

[root <at> target modprobe.d]# lsmod | grep qla
qla2xxx               516648  0
scsi_transport_fc      55299  4 qla2xxx,bnx2fc,fcoe,libfc

[root <at> target QConvergeConsoleCLI]# qaucli -t
HBA Instance 0: QLE2462 Port 1 WWPN 21-00-00-24-FF-2F-CA-3C PortID 00-00-00
Link: Link Down
No fabric attached devices on HBA (Instance 0)!
HBA Instance 1: QLE2462 Port 2 WWPN 21-00-00-24-FF-2F-CA-3D PortID 00-00-EF
(Continue reading)

Nicholas A. Bellinger | 12 Apr 23:29 2014

[GIT PULL] target updates for v3.15-rc1

Hello Linus!

Here are the target pending updates for v3.15-rc1.  Apologies in advance
for waiting until the second to last day of the merge window to send
these out.

Please go ahead and pull from:

  git:// for-next

The highlights this round include:

  - iser-target support for T10 PI (DIF) offloads (Sagi + Or)
  - Fix Task Aborted Status (TAS) handling in target-core (Alex Leung)
  - Pass in transport supported PI at session initialization (Sagi + MKP + nab)
  - Add WRITE_INSERT + READ_STRIP T10 PI support in target-core (nab + Sagi)
  - Fix iscsi-target ERL=2 ASYNC_EVENT connection pointer bug (nab)
  - Fix tcm_fc use-after-free of ft_tpg (Andy Grover)
  - Use correct ib_sg_dma primitives in ib_isert (Mike Marciniszyn)

Also, note the virtio-scsi + vhost-scsi changes to expose T10 PI
metadata into KVM guest have been left-out for now, as there where a few
comments from MST + Paolo that where not able to be addressed in time
for v3.15.  Please expect this feature for v3.16-rc1.

Thank you,


Alex Leung (2):
(Continue reading)

santosh kulkarni | 10 Apr 12:14 2014

Target fails to identify invalid ITT in DataAck

Hi ,

I see that the target is not throwing any error message (in dmesg) or 
sending a Reject PDU when a DataAck Snack with invalid Initiator Task 
Tag is sent out,
where i am sending a DataAck Snack for Data-In PDU with ITT not set to 
reserved value 0xffffffff.

RFC States

10.16.4.  Initiator Task Tag

    For Status SNACK and DataACK, the Initiator Task Tag MUST be set to
    the reserved value 0xffffffff.

Is this the default behavior.


Arshad Hussain | 9 Apr 11:21 2014

ErrorRecoveryLevel Set as read-only Randomly.

Hi Nab,

Randomly my targetcli sets 'ErrorRecoveyLevel' as read only.
I have checked the configfs and debugfs they are both mounted
with permission of read and write. What surprises me is that
the ERL and default_erl under 'tpg1' is fine. It is only the
ERL parameter under 'acls/iqn...' which is marked read-only.

Could you comment on this please ? Is there a work-around to
get over this issue?

I have provided the details below. Please let me know if there any
other info you require?


/iscsi/iqn.20...t:981fc286f48> get parameter ErrorRecoveryLevel
ErrorRecoveryLevel=No Active iSCSI Session [ro]
/iscsi/iqn.20...t:981fc286f48> set parameter ErrorRecoveryLevel=2
Parameter ErrorRecoveryLevel is read-only.

/iscsi/iqn.20...t:981fc286f48> get attribute default_erl

/iscsi/iqn.20...093081c0/tpg1> pwd
(Continue reading)

Slava Shwartsman | 8 Apr 09:19 2014

I_T nexus information on LIO


Is there any way that I can find out what initiators (iqn's) are currently
connected to the target?
Mike Marciniszyn | 7 Apr 19:58 2014

[PATCH] ib_srpt: Use correct ib_sg_dma primitives

The code was incorrectly using sg_dma_address() and
sg_dma_len() instead of ib_sg_dma_address() and

This prevents srpt from functioning with the
Intel HCA and indeed will corrupt memory

Cc: <stable <at>>
Cc: Bart Van Assche <bvanassche <at>>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro <at>>
Tested-by: Vinod Kumar <vinod.kumar <at>>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn <at>>
 drivers/infiniband/ulp/srpt/ib_srpt.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 520a7e5..b4884ae 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
 <at>  <at>  -1078,6 +1078,7  <at>  <at>  static void srpt_unmap_sg_to_ib_sge(struct srpt_rdma_ch *ch,
 static int srpt_map_sg_to_ib_sge(struct srpt_rdma_ch *ch,
 				 struct srpt_send_ioctx *ioctx)
+	struct ib_device *dev = ch->sport->sdev->device;
 	struct se_cmd *cmd;
 	struct scatterlist *sg, *sg_orig;
 	int sg_cnt;
 <at>  <at>  -1124,7 +1125,7  <at>  <at>  static int srpt_map_sg_to_ib_sge(struct srpt_rdma_ch *ch,
(Continue reading)

Nicholas A. Bellinger | 6 Apr 23:32 2014

[PATCH 0/6] vhost/scsi: Add T10 PI SGL passthrough support

From: Nicholas Bellinger <nab <at>>

Hi MST, MKP, Paolo & Co,

This is an updated patch series for adding T1O protection information (PI)
SGL passthrough support between virtio-scsi LLD + vhost-scsi fabric

Following Paolo's recommendations, this patch uses VIRTIO_SCSI_F_T10_PI
feature bits in both vhost/scsi and virtio-scsi to determine when the PI
enabled virtio_scsi_cmd_req_pi header should be used, instead of the
original virtio_scsi_cmd_req header.

As before, the change to attach protection information preceeding the
actual DataOUT + DataIN data payload, thus making a future improvement of
processing virtio buffers inline a possibility.

At this point the last item is the QEMU change to use VIRTIO_SCSI_F_T10_PI
when guest + host agree upon supported features.  Note this patch has been
tested in unprotected mode where one side does not support PI mode, and
correctly falls back to unprotected mode on both sides.

That said, I'd like to get these parts merged ASAP.

Please review.


RFCv2 -> PATCH changes:
  - Use VIRTIO_SCSI_F_T10_PI to determine PI or non PI header in
(Continue reading)

Andy Grover | 5 Apr 01:54 2014

[PATCH 0/5] target/tcm_fc: Misc. fixups

Hi nab and fcoe developers,

In fixing the other issue I just posted a patch for, I found some other
things in the tcm_fc fabric that could be improved. Please take a look?

Thanks! -- Regards -- Andy

Andy Grover (5):
  target/tcm_fc: Don't export ft_lport_list
  target/tcm_fc: Limit to 1 TPG per wwn
  target/tcm_fc: Rename structs and list members for clarity
  target/tcm_fc: Rename ft_{add,del}_lport to {add,del}_wwn
  target/tcm_fc: Rename ft_tport_create to ft_tport_get

 drivers/target/tcm_fc/tcm_fc.h   | 12 +++----
 drivers/target/tcm_fc/tfc_conf.c | 75 ++++++++++++++++++++--------------------
 drivers/target/tcm_fc/tfc_sess.c |  6 ++--
 3 files changed, 46 insertions(+), 47 deletions(-)



Alex Leung | 4 Apr 06:38 2014

[PATCH] target: Add check to prevent Abort Task from aborting itself

From: Alex Leung <alex.leung <at>>

This patch addresses an issue that occurs when an ABTS is received 
for an se_cmd that completes just before the sess_cmd_list is searched
in core_tmr_abort_task(). When the sess_cmd_list is searched, since 
the ABTS and the FCP_CMND being aborted (that just completed) both 
have the same OXID, TFO->get_task_tag(TMR) returns a value that 
matches tmr->ref_task_tag (from TFO->get_task_tag(FCP_CMND)), and
the Abort Task tries to abort itself. When this occurs, 
transport_wait_for_tasks() hangs forever since the TMR is waiting 
for itself to finish.

This patch adds a check to core_tmr_abort_task() to make sure the
TMR does not attempt to abort itself.

Signed-off-by: Alex Leung <alex.leung <at>>
 drivers/target/target_core_tmr.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
index 3f0338f..f7cd95e 100644
--- a/drivers/target/target_core_tmr.c
+++ b/drivers/target/target_core_tmr.c
 <at>  <at>  -130,6 +130,11  <at>  <at>  void core_tmr_abort_task(

 		if (dev != se_cmd->se_dev)
(Continue reading)