1. 05 6月, 2008 1 次提交
  2. 03 5月, 2008 1 次提交
  3. 02 5月, 2008 1 次提交
    • B
      [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer · 64a87b24
      Boaz Harrosh 提交于
       - struct scsi_cmnd had a 16 bytes command buffer of its own.
         This is an unnecessary duplication and copy of request's
         cmd. It is probably left overs from the time that scsi_cmnd
         could function without a request attached. So clean that up.
      
       - Once above is done, few places, apart from scsi-ml, needed
         adjustments due to changing the data type of scsi_cmnd->cmnd.
      
       - Lots of drivers still use MAX_COMMAND_SIZE. So I have left
         that #define but equate it to BLK_MAX_CDB. The way I see it
         and is reflected in the patch below is.
         MAX_COMMAND_SIZE - means: The longest fixed-length (*) SCSI CDB
                            as per the SCSI standard and is not related
                            to the implementation.
         BLK_MAX_CDB.     - The allocated space at the request level
      
       - I have audit all ISA drivers and made sure none use ->cmnd in a DMA
         Operation. Same audit was done by Andi Kleen.
      
      (*)fixed-length here means commands that their size can be determined
         by their opcode and the CDB does not carry a length specifier, (unlike
         the VARIABLE_LENGTH_CMD(0x7f) command). This is actually not exactly
         true and the SCSI standard also defines extended commands and
         vendor specific commands that can be bigger than 16 bytes. The kernel
         will support these using the same infrastructure used for VARLEN CDB's.
         So in effect MAX_COMMAND_SIZE means the maximum size command
         scsi-ml supports without specifying a cmd_len by ULD's
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      64a87b24
  4. 29 4月, 2008 1 次提交
  5. 08 4月, 2008 2 次提交
  6. 20 3月, 2008 1 次提交
    • K
      [SCSI] fix media change events for polled devices · 4d1566ed
      Kay Sievers 提交于
      Commit:
        a341cd0f (SCSI: add asynchronous event notification API)
      breaks:
        285e9670 (sr,sd: send media state change modification events)
      by introducing an event filter, which is removed here, to make
      events, we are depending on, happen again.
      
      Fix this by removing the event filter.  It's pretty much broken at the
      moment, since a user can't set it (the attribute being read only).  A
      proper fix will be to make the event discriminator distinguish between
      AN and Polled media change events.
      
      Cc: David Zeuthen <david@fubar.dk>
      Cc: kristen accardi <kaccardi@gmail.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      4d1566ed
  7. 19 2月, 2008 1 次提交
    • T
      block: add request->raw_data_len · 6b00769f
      Tejun Heo 提交于
      With padding and draining moved into it, block layer now may extend
      requests as directed by queue parameters, so now a request has two
      sizes - the original request size and the extended size which matches
      the size of area pointed to by bios and later by sgs.  The latter size
      is what lower layers are primarily interested in when allocating,
      filling up DMA tables and setting up the controller.
      
      Both padding and draining extend the data area to accomodate
      controller characteristics.  As any controller which speaks SCSI can
      handle underflows, feeding larger data area is safe.
      
      So, this patch makes the primary data length field, request->data_len,
      indicate the size of full data area and add a separate length field,
      request->raw_data_len, for the unmodified request size.  The latter is
      used to report to higher layer (userland) and where the original
      request size should be fed to the controller or device.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      6b00769f
  8. 08 2月, 2008 1 次提交
    • T
      [SCSI] fix BUG when sum(scatterlist) > bufflen · 4d2de3a5
      Tony Battersby 提交于
      When sending a SCSI command to a tape drive via the SCSI Generic (sg)
      driver, if the command has a data transfer length more than
      scatter_elem_sz (32 KB default) and not a multiple of 512, then I either
      hit BUG_ON(!valid_dma_direction(direction)) in dma_unmap_sg() or else
      the command never completes (depending on the LLDD).
      
      When constructing scatterlists, the sg driver rounds up the scatterlist
      element sizes to be a multiple of 512.  This can result in
      sum(scatterlist lengths) > bufflen.  In this case, scsi_req_map_sg()
      incorrectly sets bio->bi_size to sum(scatterlist lengths) rather than to
      bufflen.  When the command completes, req_bio_endio() detects that
      bio->bi_size != 0, and so it doesn't call bio_endio().  This causes the
      command to be resubmitted, resulting in BUG_ON or the command never
      completing.
      
      This patch makes scsi_req_map_sg() set bio->bi_size to bufflen rather
      than to sum(scatterlist lengths), which fixes the problem.
      Signed-off-by: NTony Battersby <tonyb@cybernetics.com>
      Acked-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      4d2de3a5
  9. 06 2月, 2008 2 次提交
  10. 31 1月, 2008 7 次提交
  11. 28 1月, 2008 3 次提交
  12. 24 1月, 2008 1 次提交
  13. 12 1月, 2008 5 次提交
  14. 07 1月, 2008 1 次提交
    • L
      Revert "scsi: revert "[SCSI] Get rid of scsi_cmnd->done"" · 7b3d9545
      Linus Torvalds 提交于
      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 <petero2@telia.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7b3d9545
  15. 03 1月, 2008 2 次提交
  16. 04 11月, 2007 1 次提交
  17. 02 11月, 2007 1 次提交
    • J
      [SG] Get rid of __sg_mark_end() · c46f2334
      Jens Axboe 提交于
      sg_mark_end() overwrites the page_link information, but all users want
      __sg_mark_end() behaviour where we just set the end bit. That is the most
      natural way to use the sg list, since you'll fill it in and then mark the
      end point.
      
      So change sg_mark_end() to only set the termination bit. Add a sg_magic
      debug check as well, and clear a chain pointer if it is set.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      c46f2334
  18. 23 10月, 2007 1 次提交
  19. 18 10月, 2007 1 次提交
  20. 17 10月, 2007 1 次提交
  21. 16 10月, 2007 5 次提交