1. 05 Sep, 2010 1 commit
    • Mike Christie's avatar
      [SCSI] scsi/block: increase flush/sync timeout · e3b3e624
      Mike Christie authored
      We have been seeing the flush request timeout with a wide
      range of hardware from tgt+iser to FC targets from a major vendor.
      After discussions about if the value should be configurable and
      what the best value should be, this patch just increases the flush/sync
      cache timeout to 1 minute. 2 minutes was determined to be too long, and
      making it configurable was troublesome for users.
      This patch was made over Linus's tree. It is not made over scsi-misc
      or scsi-rc-fixes, because Linus's had block layer changes that my
      patch was built over.
      Signed-off-by: default avatarMike Christie <[email protected]>
      Acked-by: default avatarJens Axboe <[email protected]>
      Signed-off-by: default avatarJames Bottomley <[email protected]>
  2. 07 Aug, 2010 1 commit
  3. 10 Dec, 2009 1 commit
  4. 02 Oct, 2009 2 commits
  5. 21 Jun, 2009 1 commit
  6. 18 Mar, 2009 1 commit
  7. 15 Oct, 2008 1 commit
  8. 13 Oct, 2008 1 commit
  9. 06 Aug, 2008 1 commit
  10. 04 Aug, 2008 1 commit
  11. 27 Jul, 2008 1 commit
    • Alan Jenkins's avatar
      [SCSI] extend the last_sector_bug flag to cover more sectors · 2b142900
      Alan Jenkins authored
      The last_sector_bug flag was added to work around a bug in certain usb
      cardreaders, where they would crash if a multiple sector read included the
      last sector. The original implementation avoids this by e.g. splitting an 8
      sector read which includes the last sector into a 7 sector read, and a single
      sector read for the last sector.  The flag is enabled for all USB devices.
      This revealed a second bug in other usb cardreaders, which crash when they
      get a multiple sector read which stops 1 sector short of the last sector.
      Affected hardware includes the Kingston "MobileLite" external USB cardreader
      and the internal USB cardreader on the Asus EeePC.
      Extend the last_sector_bug workaround to ensure that any access which touches
      the last 8 hardware sectors of the device is a single sector long.  Requests
      are shrunk as necessary to meet this constraint.
      This gives us a safety margin against potential unknown or future bugs
      affecting multi-sector access to the end of the device.  The two known bugs
      only affect the last 2 sectors.  However, they suggest that these devices
      are prone to fencepost errors and that multi-sector access to the end of the
      device is not well tested.  Popular OS's use multi-sector accesses, but they
      rarely read the last few sectors.  Linux (with udev & vol_id) automatically
      reads sectors from the end of the device on insertion.  It is assumed that
      single sector accesses are more thoroughly tested during development.
      Signed-off-by: default avatarAlan Jenkins <[email protected]>
      Tested-by: default avatarAlan Jenkins <[email protected]>
      Signed-off-by: default avatarJames Bottomley <[email protected]>
  12. 26 Jul, 2008 2 commits
  13. 12 Jul, 2008 2 commits
  14. 20 Apr, 2008 1 commit
  15. 12 Jan, 2008 1 commit
    • Kay Sievers's avatar
      [SCSI] sr,sd: send media state change modification events · 285e9670
      Kay Sievers authored
      This will send for a card reader slot (remove/add media):
        UEVENT[1187091572.155884] change   /devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/host7/target7:0:0/7:0:0:0 (scsi)
        UEVENT[1187091572.162314] remove   /block/sdb/sdb1 (block)
        UEVENT[1187091572.172464] add      /block/sdb/sdb1 (block)
        UEVENT[1187091572.175408] change   /devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/host7/target7:0:0/7:0:0:0 (scsi)
      and for a DVD drive (add/eject media):
        UEVENT[1187091590.189159] change   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)
        UEVENT[1187091590.957124] add      /module/isofs (module)
        UEVENT[1187091604.468207] change   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)
      Userspace gets events, even for unpartitioned media. This unifies
      the event handling for asynchronoous events (AN) and events caused by
      perodical polling the device from userspace.
      Signed-off-by: default avatarKay Sievers <[email protected]>
      [jejb: modified for new event API]
      Signed-off-by: default avatarJames Bottomley <[email protected]>
  16. 06 Jan, 2008 1 commit
    • Linus Torvalds's avatar
      Revert "scsi: revert "[SCSI] Get rid of scsi_cmnd->done"" · 7b3d9545
      Linus Torvalds authored
      This reverts commit ac40532e, which gets
      us back the original cleanup of 6f5391c2.
      It turns out that the bug that was triggered by that commit was
      apparently not actually triggered by that commit at all, and just the
      testing conditions had changed enough to make it appear to be due to it.
      The real problem seems to have been found by Peter Osterlund:
        "pktcdvd sets it [block device size] when opening the /dev/pktcdvd
         device, but when the drive is later opened as /dev/scd0, there is
         nothing that sets it back.  (Btw, 40944 is possible if the disk is a
         CDRW that was formatted with "cdrwtool -m 10236".)
         The problem is that pktcdvd opens the cd device in non-blocking mode
         when pktsetup is run, and doesn't close it again until pktsetup -d is
         run.  The effect is that if you meanwhile open the cd device,
         blkdev.c:do_open() doesn't call bd_set_size() because
         bdev->bd_openers is non-zero."
      In particular, to repeat the bug (regardless of whether commit
      6f5391c2 is applied or not):
        " 1. Start with an empty drive.
          2. pktsetup 0 /dev/scd0
          3. Insert a CD containing an isofs filesystem.
          4. mount /dev/pktcdvd/0 /mnt/tmp
          5. umount /mnt/tmp
          6. Press the eject button.
          7. Insert a DVD containing a non-writable filesystem.
          8. mount /dev/scd0 /mnt/tmp
          9. find /mnt/tmp -type f -print0 | xargs -0 sha1sum >/dev/null
          10. If the DVD contains data beyond the physical size of a CD, you
              get I/O errors in the terminal, and dmesg reports lots of
              "attempt to access beyond end of device" errors."
      which in turn is because the nested open after the media change won't
      cause the size to be set properly (because the original open still holds
      the block device, and we only do the bd_set_size() when we don't have
      other people holding the device open).
      The proper fix for that is probably to just do something like
      	bdev->bd_inode->i_size = (loff_t)get_capacity(disk)<<9;
      in fs/block_dev.c:do_open() even for the cases where we're not the
      original opener (but *not* call bd_set_size(), since that will also
      change the block size of the device).
      Cc: Peter Osterlund <[email protected]>
      Cc: James Bottomley <[email protected]>
      Cc: Matthew Wilcox <[email protected]>
      Cc: Ingo Molnar <[email protected]>
      Cc: Andrew Morton <ak[email protected]>
      Signed-off-by: default avatarLinus Torvalds <[email protected]>
  17. 02 Jan, 2008 1 commit
  18. 12 Oct, 2007 2 commits
    • Matthew Wilcox's avatar
      [SCSI] Get rid of scsi_cmnd->done · 6f5391c2
      Matthew Wilcox authored
      The ULD ->done callback moves into the scsi_driver.  By moving the call
      to scsi_io_completion() from scsi_blk_pc_done() to scsi_finish_command(),
      we can eliminate the latter entirely.  By returning 'good_bytes' from
      the ->done callback (rather than invoking scsi_io_completion()), we can
      stop exporting scsi_io_completion().
      Also move the prototypes from sd.h to sd.c as they're all internal anyway.
      Rename sd_rw_intr to sd_done and rw_intr to sr_done.
      Inspired-by: default avatarChristoph Hellwig <[email protected]>
      Signed-off-by: default avatarMatthew Wilcox <[email protected]>
      Signed-off-by: default avatarJames Bottomley <[email protected]>
    • James Bottomley's avatar
      [SCSI] move ULD attachment into the prep function · 7f9a6bc4
      James Bottomley authored
      One of the intents of the block prep function was to allow ULDs to use
      it for preprocessing.  The original SCSI model was to have a single prep
      function and add a pointer indirect filter to build the necessary
      commands.  This patch reverses that, does away with the init_command
      field of the scsi_driver structure and makes ULDs attach directly to the
      prep function instead.  The value is really that it allows us to begin
      to separate the ULDs from the SCSI mid layer (as long as they don't use
      any core functions---which is hard at the moment---a ULD doesn't even
      need SCSI to bind).
      Acked-by: default avatarJens Axboe <[email protected]>
      Signed-off-by: default avatarJames Bottomley <[email protected]>
  19. 04 Aug, 2007 1 commit
  20. 24 Jul, 2007 1 commit
  21. 20 Mar, 2007 1 commit
    • Tejun Heo's avatar
      [SCSI] sd: implement START/STOP management · c3c94c5a
      Tejun Heo authored
      Implement SBC START/STOP management.  sdev->mange_start_stop is added.
      When it's set to one, sd STOPs the device on suspend and shutdown and
      STARTs it on resume.  sdev->manage_start_stop defaults is in sdev
      instead of scsi_disk cdev to allow ->slave_config() override the
      default configuration but is exported under scsi_disk sysfs node as
      sdev->allow_restart is.
      When manage_start_stop is zero (the default value), this patch doesn't
      introduce any behavior change.
      Signed-off-by: default avatarTejun Heo <[email protected]>
      Rejections fixed and
      Signed-off-by: default avatarJames Bottomley <[email protected]>
  22. 11 Mar, 2007 1 commit