Bugzilla – Bug 129980
iSCSI enterprise target does not work
Last modified: 2005-10-26 06:42:38 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
aj, this requires just a kernel patch. Ok to fix?
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...
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.