HeikoKoehler / istgt

Automatically exported from code.google.com/p/istgt
Other
0 stars 0 forks source link

no response to read10 CDB when went sent as iSCSI data-out write #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following request (generated by libiscsi's 0105_read10_invalid test) does 
not bring a response from istgt:

iSCSI (SCSI Command)
    Opcode: SCSI Command (0x01)
    .0.. .... = I: Queued delivery 
    Flags: 0xa1
        1... .... = F: Final PDU in sequence
        .0.. .... = R: No data will be read from target
        ..1. .... = W: Data will be written to target
        .... .001 = Attr: Simple (0x01)
    TotalAHSLength: 0x00
    DataSegmentLength: 4096 (0x00001000)
    LUN: 0 (Single Level LUN Structure)
        00.. .... = Address Mode: Single Level LUN Structure (0)
        ..00 0000 = BUS: 0
        LUN: 0
    InitiatorTaskTag: 0x00000006
    ExpectedDataTransferLength: 0x00001000
    CmdSN: 0x00000005
    ExpStatSN: 0x00000006
    ImmediateData: 000000000000000000000000000000000000000000000000...
SCSI CDB Read(10) 
    [LUN: 0] 
    [Command Set:Direct Access Device (0x00) (Using default commandset)]
    Opcode: Read(10) (0x28)
    Flags: 0x00 
        000. .... = RDPROTECT: 0x00
        ...0 .... = DPO: Disable page out is DISABLED (cache this data)
        .... 0... = FUA: Read from cache if possible
        .... ..0. = FUA_NV: Read from volatile or non-volatile cache permitted
    Logical Block Address (LBA): 0
    ...0 0000 = Group: 0x00
    Transfer Length: 1
    Control: 0x00 
        00.. .... = Vendor specific: 0x00
        ..00 0... = Reserved: 0x00 
        .... .0.. = NACA: Normal ACA is not set
        .... ..0. = Obsolete: 0x00
        .... ...0 = Obsolete: 0x00

Note that the iSCSI transport layer flags the packet as a write with immediate 
data, but the CBD is a 1-block read.

Original issue reported on code.google.com by ddiss....@gmail.com on 22 Dec 2014 at 12:48

GoogleCodeExporter commented 9 years ago
Fix pushed to the devel_20141125 with:

commit c69950e5b1251852cabe1d47ff1c7613208d3b41
Author: David Disseldorp <ddiss@suse.de>
Date:   Mon Dec 22 02:03:49 2014 +0100

    lu: return CHECK_CONDITION error on invalid READ

    READ CDBs which do not carry the iSCSI R flag do not currently result in
    an error response. This change ensures that the CHECK_CONDITION error is
    propagated back to the initiator.

    Signed-off-by: David Disseldorp <ddiss@suse.de>

Original comment by ddiss....@gmail.com on 22 Dec 2014 at 1:09

GoogleCodeExporter commented 9 years ago

Original comment by ddiss....@gmail.com on 22 Dec 2014 at 1:10