1. 20 3月, 2014 4 次提交
  2. 17 12月, 2013 1 次提交
  3. 25 10月, 2013 5 次提交
  4. 03 9月, 2013 2 次提交
  5. 10 7月, 2013 1 次提交
    • A
      scsi_debug: fix do_device_access() with wrap around range · a4517511
      Akinobu Mita 提交于
      do_device_access() is a function that abstracts copying SG list from/to
      ramdisk storage (fake_storep).
      
      It must deal with the ranges exceeding actual fake_storep size, because
      such ranges are valid if virtual_gb is set greater than zero, and they
      should be treated as fake_storep is repeatedly mirrored up to virtual
      size.
      
      Unfortunately, it can't deal with the range which wraps around the end of
      fake_storep.  A wrap around range is copied by two
      sg_copy_{from,to}_buffer() calls, but sg_copy_{from,to}_buffer() can't
      copy from/to in the middle of SG list, therefore the second call can't
      copy correctly.
      
      This fixes it by using sg_pcopy_{from,to}_buffer() that can copy from/to
      the middle of SG list.
      
      This also simplifies the assignment of sdb->resid in
      fill_from_dev_buffer().  Because fill_from_dev_buffer() is now only called
      once per command execution cycle.  So it is not necessary to take care to
      decrease sdb->resid if fill_from_dev_buffer() is called more than once.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
      Cc: Douglas Gilbert <dgilbert@interlog.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Horia Geanta <horia.geanta@freescale.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a4517511
  6. 09 7月, 2013 6 次提交
  7. 03 5月, 2013 4 次提交
  8. 10 4月, 2013 1 次提交
  9. 09 10月, 2012 1 次提交
  10. 24 9月, 2012 1 次提交
  11. 27 3月, 2012 2 次提交
  12. 20 3月, 2012 1 次提交
  13. 20 2月, 2012 1 次提交
    • M
      [SCSI] Handle disk devices which can not process medium access commands · 18a4d0a2
      Martin K. Petersen 提交于
      We have experienced several devices which fail in a fashion we do not
      currently handle gracefully in SCSI. After a failure these devices will
      respond to the SCSI primary command set (INQUIRY, TEST UNIT READY, etc.)
      but any command accessing the storage medium will time out.
      
      The following patch adds an callback that can be used by upper level
      drivers to inspect the results of an error handling command. This in
      turn has been used to implement additional checking in the SCSI disk
      driver.
      
      If a medium access command fails twice but TEST UNIT READY succeeds both
      times in the subsequent error handling we will offline the device. The
      maximum number of failed commands required to take a device offline can
      be tweaked in sysfs.
      
      Also add a new error flag to scsi_debug which allows this scenario to be
      easily reproduced.
      
      [jejb: fix up integer parsing to use kstrtouint]
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      18a4d0a2
  14. 19 2月, 2012 1 次提交
    • D
      [SCSI] scsi_debug: GET LBA STATUS response length correction · de13e965
      Douglas Gilbert 提交于
      The SCSI GET LBA STATUS command was introduced in SBC-3 revision
      20 in September 2009. At that time the Parameter Data Length
      field in the response had an associated byte offset of 8.
      
      Then in SBC-3 revision 25 (October 2010) that byte offset was
      changed to 4. The sg_get_lba_status utility in sg3_utils version
      1.33 (released earlier today) has been changed to calculate
      the newer response length. However the implementation of
      GET LBA STATUS command in the scsi_debug driver still uses the
      original byte offset.
      
      modify the Parameter Data Length field value in the GET LBA STATUS command
      response to comply with the change in SBC-3 revision 25
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      de13e965
  15. 31 3月, 2011 1 次提交
  16. 15 3月, 2011 2 次提交
    • D
      [SCSI] scsi_debug: add consecutive medium errors · 32f7ef73
      Douglas Gilbert 提交于
      A useful test case for error recovery is multiple,
      consecutive medium errors. When scsi_debug is started
      with "opts=2" a MEDIUM ERROR is generated when block
      0x1234 (4660) is read. The patch extends that to
      10 consecutive blocks from 0x1234 (i.e. blocks 4660 to
      4669 inclusive).
      
      [0:0:0:0]  disk  ATA    INTEL SSD  2CV1 /dev/sda /dev/sg0 80.0GB
      [10:0:0:0] disk  Linux  scsi_debug 0004 /dev/sdb /dev/sg1 1.09TB
      
      Output file not specified so no copy, just reading input
       >> unrecovered read error at blk=4660, substitute zeros
      ...
       >> unrecovered read error at blk=4669, substitute zeros
      4670+10 records in
      0+0 records out
      10 unrecovered read errors
      lowest unrecovered read lba=4660, highest unrecovered lba=4669
      time to read data: 0.047943 secs at 49.87 MB/sec
      
      BTW Change /dev/sg1 (bsg device works just as well) to
      /dev/sdb to see why, with faulty media, you do not want
      to use the block layer interface. Reason: time block
      layer takes to do useless retries and collateral damage
      to data in its 4 KB blocks (O_DIRECT mitigates the
      latter).
      
      ChangeLog:
          - extend opts=2 medium error generation at block
            0x1234 to 10 consecutive blocks (i.e. blocks
            0x1234 to 0x123d).
      Signed-off-by: NDouglas Gilbert <dgilbert@interlog.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      32f7ef73
    • M
      [SCSI] scsi_debug: Logical Block Provisioning (SBC3r26) · 5b94e232
      Martin K. Petersen 提交于
      Update scsi_debug to support the Logical Block Provisioning commands and
      bits as defined in SBC3r26. The old tp* parameters have been
      transitioned to the new lbp* scheme found in the draft standard.
      
      The old tpu option to enable UNMAP is now called lbpu. tpws to signal
      support for WRITE SAME(16) with the UNMAP bit set is now lbpws. Support
      for WRITE SAME(10) with the UNMAP bit set is also available using the
      lpuws10 parameter.
      
      Limiting the maximum number of blocks per WRITE SAME command has been
      implemented and is available via the write_same_length module parameter.
      
      As part of the renaming process the parameter lists have been sorted
      alphabetically (request from Doug).
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Acked-by: NDouglas Gilbert <dgilbert@interlog.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      5b94e232
  17. 13 2月, 2011 1 次提交
  18. 23 12月, 2010 1 次提交
  19. 17 11月, 2010 1 次提交
    • J
      SCSI host lock push-down · f281233d
      Jeff Garzik 提交于
      Move the mid-layer's ->queuecommand() invocation from being locked
      with the host lock to being unlocked to facilitate speeding up the
      critical path for drivers who don't need this lock taken anyway.
      
      The patch below presents a simple SCSI host lock push-down as an
      equivalent transformation.  No locking or other behavior should change
      with this patch.  All existing bugs and locking orders are preserved.
      
      Additionally, add one parameter to queuecommand,
      	struct Scsi_Host *
      and remove one parameter from queuecommand,
      	void (*done)(struct scsi_cmnd *)
      
      Scsi_Host* is a convenient pointer that most host drivers need anyway,
      and 'done' is redundant to struct scsi_cmnd->scsi_done.
      
      Minimal code disturbance was attempted with this change.  Most drivers
      needed only two one-line modifications for their host lock push-down.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      Acked-by: NJames Bottomley <James.Bottomley@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f281233d
  20. 17 9月, 2010 1 次提交
  21. 10 9月, 2010 1 次提交
  22. 28 7月, 2010 1 次提交