Hi Santosh, On Thu, 2013-11-07 at 11:55 +0530, santosh kulkarni wrote: > Hi Nicholas, > > On Wednesday 06 November 2013 11:57 PM, Nicholas A. Bellinger wrote: <SNIP> > >> 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. > Have you been able to confirm with this patch..? It's been included into for-next, as it's a pretty obvious change to me, but I'd still like to see a test confirmation. Thanks, --nab -- 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