Re: LIO Target behavior when Data-out PDU with DataSegmentLength = 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Nicholas,

On Wednesday 06 November 2013 11:57 PM, Nicholas A. Bellinger wrote:
Hi Santosh,

On Wed, 2013-11-06 at 11:50 +0530, santosh kulkarni wrote:
Hi,

I am currently working on developing a iSCSI protocol conformance suite.
I am currently testing it against a  LIO based target.
The LIO target details are as follows
kernel : 3.10.13-101.fc18.x86_64 #1 SMP(Fedora 18)
rpm -qa | grep target
scsi-target-utils-1.0.38-1.fc18.x86_64
selinux-policy-targeted-3.11.1-66.fc18.noarch
targetcli-2.1.fb30-1.fc18.noarch
I am facing few issues and needed to clarify few of my doubts.
1. Our suite currently checks the behavior of a target when a Data-Out
PDU with  DataSegmentLength set to 0 is sent out. And what i see in the
target is as follows

~# dmesg
[599509.602032] DataOUT payload is ZERO, protocol error.
[599675.065060] DataOUT payload is ZERO, protocol error.

But the RFC states the following



10.7.7.  DataSegmentLength
This is the data payload length of a SCSI Data-In or SCSI Data-Out PDU.
"The sending of 0 length data segments should be avoided, but initiators
and targets MUST be able to properly receive 0 length data

     segments."
Is this the default behavior of LIO. It would be great if someone could
clarify my doubts.

Here is a quick patch to drop the sending of the REJECT, and ignore zero
length ISCSI_OP_SCSI_DATA_OUTs.

Care to test..?

--nab

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index e183352..ab64cbb 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -1249,9 +1249,8 @@ iscsit_check_dataout_hdr(struct iscsi_conn *conn, unsigned char *buf,
         int rc;
if (!payload_length) {
-               pr_err("DataOUT payload is ZERO, protocol error.\n");
-               return iscsit_add_reject(conn, ISCSI_REASON_PROTOCOL_ERROR,
-                                        buf);
+               pr_warn("DataOUT payload is ZERO, ignoring.\n");
+               return 0;
         }
/* iSCSI write */
@@ -1481,7 +1480,7 @@ EXPORT_SYMBOL(iscsit_check_dataout_payload);
static int iscsit_handle_data_out(struct iscsi_conn *conn, unsigned char *buf)
  {
-       struct iscsi_cmd *cmd;
+       struct iscsi_cmd *cmd = NULL;
         struct iscsi_data *hdr = (struct iscsi_data *)buf;
         int rc;
         bool data_crc_failed = false;



Thanks for the quick fix.Will try to apply it and test it out.

Regards
Santosh.
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux