• Nicholas Bellinger's avatar
    target: Fix incorrect starting offset after MODE_SENSE refactoring · fecae40a
    Nicholas Bellinger authored
    This patch fixes a new off-by-one bug in the hardcoded starting offset of
    spc_emulate_modesense() code that causes BLOCK DESCRIPTOR to be incorrectly
    written within the MEDIUM TYPE buffer area of the mode parameter header.
    
    According to spc4r30, Section 7.5.4, BLOCK DESCRIPTOR for MODE_SENSE_10
    starts at byte 3, and BLOCK_DESCRIPTOR for MODE_SENSE (6) starts at byte 2.
    
    (roland: add MODE DATA LENGTH + MEDIUM TYPE offset comment)
    
    Cc: Roland Dreier <roland@purestorage.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Douglas Gilbert <dgilbert@interlog.com>
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    fecae40a
target_core_spc.c 34.5 KB