1. 24 10月, 2008 3 次提交
  2. 13 10月, 2008 2 次提交
    • M
      [SCSI] modify scsi to handle new fail fast flags. · 4a27446f
      Mike Christie 提交于
      This checks the errors the scsi-ml determined were retryable
      and returns if we should fast fail it based on the request
      fail fast flags.
      
      Without the patch, drivers like lpfc, qla2xxx and fcoe would return
      DID_ERROR for what it determines is a temporary communication problem.
      There is no loss of connectivity at that time and the driver thinks
      that it would be fast to retry at the driver level. SCSI-ml will however
      sees fast fail on the request and DID_ERROR and will fast fail the io.
      This will then cause dm-multipath to fail the path and possibley switch
      target controllers when we should be retrying at the scsi layer.
      
      We also were fast failing device errors to dm multiapth when
      unless the scsi_dh modules think otherwis we want to retry at
      the scsi layer because multipath can only retry the IO like scsi
      should have done. multipath is a little dumber though because it
      does not what the error was for and assumes that it should fail
      the paths.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      4a27446f
    • M
      [SCSI] Add helper code so transport classes/driver can control queueing (v3) · f0c0a376
      Mike Christie 提交于
      SCSI-ml manages the queueing limits for the device and host, but
      does not do so at the target level. However something something similar
      can come in userful when a driver is transitioning a transport object to
      the the blocked state, becuase at that time we do not want to queue
      io and we do not want the queuecommand to be called again.
      
      The patch adds code similar to the exisiting SCSI_ML_*BUSY handlers.
      You can now return SCSI_MLQUEUE_TARGET_BUSY when we hit
      a transport level queueing issue like the hw cannot allocate some
      resource at the iscsi session/connection level, or the target has temporarily
      closed or shrunk the queueing window, or if we are transitioning
      to the blocked state.
      
      bnx2i, when they rework their firmware according to netdev
      developers requests, will also need to be able to limit queueing at this
      level. bnx2i will hook into libiscsi, but will allocate a scsi host per
      netdevice/hba, so unlike pure software iscsi/iser which is allocating
      a host per session, it cannot set the scsi_host->can_queue and return
      SCSI_MLQUEUE_HOST_BUSY to reflect queueing limits on the transport.
      
      The iscsi class/driver can also set a scsi_target->can_queue value which
      reflects the max commands the driver/class can support. For iscsi this
      reflects the number of commands we can support for each session due to
      session/connection hw limits, driver limits, and to also reflect the
      session/targets's queueing window.
      
      Changes:
      v1 - initial patch.
      v2 - Fix scsi_run_queue handling of multiple blocked targets.
      Previously we would break from the main loop if a device was added back on
      the starved list. We now run over the list and check if any target is
      blocked.
      v3 - Rediff for scsi-misc.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      f0c0a376
  3. 09 10月, 2008 1 次提交
  4. 04 10月, 2008 1 次提交
  5. 24 9月, 2008 1 次提交
    • J
      [SCSI] Fix hang with split requests · 44ea91c5
      James Bottomley 提交于
      Sometimes, particularly for USB devices with the last sector bug,
      requests get completed in chunks.  There's a bug in this in that if
      one of the chunks gets an error, we complete that chunk with an error
      but never move on to the remaining ones, leading to the request
      hanging (because it's not fully completed).
      
      Fix this by completing all remaining chunks if an error is encountered.
      
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      44ea91c5
  6. 27 7月, 2008 5 次提交
  7. 12 7月, 2008 2 次提交
  8. 07 7月, 2008 1 次提交
  9. 05 6月, 2008 1 次提交
  10. 03 5月, 2008 1 次提交
  11. 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
  12. 29 4月, 2008 1 次提交
  13. 08 4月, 2008 2 次提交
  14. 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
  15. 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
  16. 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
  17. 06 2月, 2008 2 次提交
  18. 31 1月, 2008 7 次提交
  19. 28 1月, 2008 3 次提交
  20. 24 1月, 2008 1 次提交
  21. 12 1月, 2008 2 次提交