1. 31 Oct, 2016 38 commits
  2. 28 Oct, 2016 2 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.8.5 · 3cf02960
      Greg Kroah-Hartman authored
      3cf02960
    • Nicholas Bellinger's avatar
      Revert "target: Fix residual overflow handling in target_complete_cmd_with_length" · 7979d3c6
      Nicholas Bellinger authored
      commit 61f36166 upstream.
      
      This reverts commit c1ccbfe0.
      
      Reverting this patch, as it incorrectly assumes the additional length
      for INQUIRY in target_complete_cmd_with_length() is SCSI allocation
      length, which breaks existing user-space code when SCSI allocation
      length is smaller than additional length.
      
        root@scsi-mq:~# sg_inq --len=4 -vvvv /dev/sdb
        found bsg_major=253
        open /dev/sdb with flags=0x800
            inquiry cdb: 12 00 00 00 04 00
              duration=0 ms
            inquiry: pass-through requested 4 bytes (data-in) but got -28 bytes
            inquiry: pass-through can't get negative bytes, say it got none
            inquiry: got too few bytes (0)
        INQUIRY resid (32) should never exceed requested len=4
            inquiry: failed requesting 4 byte response: Malformed response to
                     SCSI command [resid=32]
      
      AFAICT the original change was not to address a specific host issue,
      so go ahead and revert to original logic for now.
      
      Cc: Douglas Gilbert <dgilbert@interlog.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Sumit Rai <sumitrai96@gmail.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7979d3c6