Bug 129980 - iSCSI enterprise target does not work
Summary: iSCSI enterprise target does not work
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Other (show other bugs)
Version: Final
Hardware: x86 SuSE Linux 10.0
: P5 - None : Critical
Target Milestone: ---
Assignee: Hannes Reinecke
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-21 15:18 UTC by Chaofeng Kao
Modified: 2005-10-26 06:42 UTC (History)
0 users

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chaofeng Kao 2005-10-21 15:18:48 UTC
I setup a SUSE 10 with iSCSI enterprise target. And then I used iSCSI
> initiator from NetWare to connect the target.  What I found from the
> network trace is:
> a) iSCSI login and text commands work, then
> b) iSCSI initiator issued a SCSI command to read capacity of the
> device.
> c) iSCSI target responded a SCSI Data-In.  The response missed last 8
> bytes for SCSI payload for read capacity.

Hannes knows the issue. He already has a patch
Comment 1 Hannes Reinecke 2005-10-24 06:33:32 UTC
aj, this requires just a kernel patch. Ok to fix?
Comment 2 Andreas Jaeger 2005-10-25 06:42:58 UTC
Add it to our 10.0 kernel - and to the 10.1 kernel.

It will then go out with the next security update of the 10.0 kernel...
Comment 3 Hannes Reinecke 2005-10-26 06:42:38 UTC
The patch is actually quite simple:

diff -u -r1.1 iscsitarget-align-with-open-iscsi.patch
--- patches.drivers/iscsitarget-align-with-open-iscsi.patch     22 Aug 2005 10:33:22 -0000      1.1
+++ patches.drivers/iscsitarget-align-with-open-iscsi.patch     26 Oct 2005 06:36:05 -0000
--- linux-2.6.12/drivers/scsi/iscsitarget/iscsi.c
+++ linux-2.6.12/drivers/scsi/iscsitarget/iscsi.c
@@ -75,7 +75,7 @@  static u32 cmnd_write_size(struct iscsi_cmnd
      if (hdr->flags & ISCSI_CMD_WRITE)
              return be32_to_cpu(hdr->data_length);
      if (hdr->flags & ISCSI_FLAG_CMD_WRITE)
-             return ntoh24(hdr->dlength);
+             return be32_to_cpu(hdr->data_length);
        return 0;
  }
  
@@ -90,7 +90,7 @@  static u32 cmnd_read_size(struct iscsi_cmnd *cmnd
              if (hdr->flags & ISCSI_CMD_READ) {
      if (hdr->flags & ISCSI_FLAG_CMD_READ) {
              if (!(hdr->flags & ISCSI_FLAG_CMD_WRITE))
-                     return ntoh24(hdr->dlength);
+                     return be32_to_cpu(hdr->data_length);
              if (hdr->flags & ISCSI_FLAG_CMD_READ) {
                      struct iscsi_rlength_ahdr *ahdr =
                              (struct iscsi_rlength_ahdr *)cmnd->pdu.ahs;

(Beware, hand-crafted patch).

fixed in kernel CVS. Will be pushed out with the next maintenance release.