1. 22 8月, 2012 3 次提交
    • M
      [SCSI] scsi_lib: fix scsi_io_completion's SG_IO error propagation · 27c41973
      Mike Snitzer 提交于
      The following v3.4-rc1 commit unmasked an existing bug in scsi_io_completion's
      SG_IO error handling: 47ac56db [SCSI] scsi_error: classify some ILLEGAL_REQUEST
      sense as a permanent TARGET_ERROR
      
      Given that certain ILLEGAL_REQUEST are now properly categorized as
      TARGET_ERROR the host_byte is being set (before host_byte wasn't ever
      set for these ILLEGAL_REQUEST).
      
      In scsi_io_completion, initialize req->errors with cmd->result _after_
      the SG_IO block that calls __scsi_error_from_host_byte (which may
      modify the host_byte).
      
      Before this fix:
      
          cdb to send: 12 01 01 00 00 00
      ioctl(3, SG_IO, {'S', SG_DXFER_NONE, cmd[6]=[12, 01, 01, 00, 00, 00],
          mx_sb_len=32, iovec_count=0, dxfer_len=0, timeout=20000, flags=0,
          status=02, masked_status=01, sb[19]=[70, 00, 05, 00, 00, 00, 00, 0b,
          00, 00, 00, 00, 24, 00, 00, 00, 00, 00, 00], host_status=0x10,
          driver_status=0x8, resid=0, duration=0, info=0x1}) = 0
      SCSI Status: Check Condition
      
      Sense Information:
      sense buffer empty
      
      After:
      
          cdb to send: 12 01 01 00 00 00
      ioctl(3, SG_IO, {'S', SG_DXFER_NONE, cmd[6]=[12, 01, 01, 00, 00, 00],
          mx_sb_len=32, iovec_count=0, dxfer_len=0, timeout=20000, flags=0,
          status=02, masked_status=01, sb[19]=[70, 00, 05, 00, 00, 00, 00, 0b,
          00, 00, 00, 00, 24, 00, 00, 00, 00, 00, 00], host_status=0,
          driver_status=0x8, resid=0, duration=0, info=0x1}) = 0
      SCSI Status: Check Condition
      
      Sense Information:
       Fixed format, current;  Sense key: Illegal Request
       Additional sense: Invalid field in cdb
       Raw sense data (in hex):
              70 00 05 00 00 00 00 0b  00 00 00 00 24 00 00 00
              00 00 00
      Reported-by: NPaolo Bonzini <pbonzini@redhat.com>
      Tested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Reviewed-by: NBabu Moger <babu.moger@netapp.com>
      Cc: stable@vger.kernel.org # 3.4
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      27c41973
    • K
      [SCSI] megaraid_sas: Move poll_aen_lock initializer · bd8d6dd4
      Kashyap Desai 提交于
      The following patch moves the poll_aen_lock initializer from
      megasas_probe_one() to megasas_init().  This prevents a crash when a user
      loads the driver and tries to issue a poll() system call on the ioctl
      interface with no adapters present.
      Signed-off-by: NKashyap Desai <Kashyap.Desai@lsi.com>
      Signed-off-by: NAdam Radford <aradford@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      bd8d6dd4
    • S
      [SCSI] mpt2sas: Fix for Driver oops, when loading driver with max_queue_depth... · 338b131a
      sreekanth.reddy@lsi.com 提交于
      [SCSI] mpt2sas: Fix for Driver oops, when loading driver with max_queue_depth command line option to a very small value
      
      If the specified max_queue_depth setting is less than the
      expected number of internal commands, then driver will calculate
      the queue depth size to a negitive number. This negitive number
      is actually a very large number because variable is unsigned
      16bit integer. So, the driver will ask for a very large amount of
      memory for message frames and resulting into oops as memory
      allocation routines will not able to handle such a large request.
      
      So, in order to limit this kind of oops, The driver need to set
      the max_queue_depth to a scsi mid layer's can_queue value. Then
      the overall message frames required for IO is minimum of either
      (max_queue_depth plus internal commands) or the IOC global
      credits.
      Signed-off-by: NSreekanth Reddy <sreekanth.reddy@lsi.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      338b131a
  2. 20 7月, 2012 37 次提交