1. 18 1月, 2010 1 次提交
    • B
      [SCSI] scsi_lib: Fix bug in completion of bidi commands · 63c43b0e
      Boaz Harrosh 提交于
      Because of the terrible structuring of scsi-bidi-commands
      it breaks some of the life time rules of a scsi-command.
      It is now not allowed to free up the block-request before
      cleanup and partial deallocation of the scsi-command. (Which
      is not so for none bidi commands)
      
      The right fix to this problem would be to make bidi command
      a first citizen by allocating a scsi_sdb pointer at scsi command
      just like cmd->prot_sdb. The bidi sdb should be allocated/deallocated
      as part of the get/put_command (Again like the prot_sdb) and the
      current decoupling of scsi_cmnd and blk-request should be kept.
      
      For now make sure scsi_release_buffers() is called before the
      call to blk_end_request_all() which might cause the suicide of
      the block requests. At best the leak of bidi buffers, at worse
      a crash, as there is a race between the existence of the bidi_request
      and the free of the associated bidi_sdb.
      
      The reason this was never hit before is because only OSD has the potential
      of doing asynchronous bidi commands. (So does bsg but it is never used)
      And OSD clients just happen to do all their bidi commands synchronously, up
      until recently.
      
      CC: Stable Tree <stable@kernel.org>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      63c43b0e
  2. 10 12月, 2009 1 次提交
  3. 05 12月, 2009 1 次提交
  4. 30 10月, 2009 1 次提交
  5. 11 9月, 2009 1 次提交
    • T
      scsi,block: update SCSI to handle mixed merge failures · da6c5c72
      Tejun Heo 提交于
      Update scsi_io_completion() such that it only fails requests till the
      next error boundary and retry the leftover.  This enables block layer
      to merge requests with different failfast settings and still behave
      correctly on errors.  Allow merge of requests of different failfast
      settings.
      
      As SCSI is currently the only subsystem which follows failfast status,
      there's no need to worry about other block drivers for now.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Niel Lambrechts <niel.lambrechts@gmail.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      da6c5c72
  6. 23 8月, 2009 1 次提交
  7. 22 6月, 2009 1 次提交
  8. 24 5月, 2009 1 次提交
    • T
      [SCSI] limit state transitions in scsi_internal_device_unblock · 5c10e63c
      Takahiro Yasui 提交于
      scsi timeout on two or more devices may cause extremely long execution
      time for user applications because SDEV_OFFLINE state is changed to
      SDEV_RUNNING state during scsi error recovery procedures triggered by
      a bus reset or a host reset of scsi LLD, and scsi timeout can happens
      on the same devices many times.
      
      This happens because scsi_internal_device_unblock() changes device's
      state to SDEV_RUNNING even if a device in other states than SDEV_BLOCK,
      while the following two transitions are required in this function.
      
        SDEV_BLOCK -> SDEV_RUNNING
        SDEV_CREATED_BLOCK -> SDEV_CREATED
      
      Otherwise, it returns -EINVAL.
      Signed-off-by: NTakahiro Yasui <tyasui@redhat.com>
      [matthew@wil.cx: supplied rewritten base for patch]
      Signed-off-by: NMatthew Wilcox <matthew@wil.cx>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      5c10e63c
  9. 20 5月, 2009 1 次提交
  10. 12 5月, 2009 1 次提交
  11. 11 5月, 2009 7 次提交
    • F
      scsi: simplify the bidi completion · e6bb7a96
      FUJITA Tomonori 提交于
      Let's use blk_end_request_all() instead of blk_end_bidi_request().
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      e6bb7a96
    • T
      block: implement and enforce request peek/start/fetch · 9934c8c0
      Tejun Heo 提交于
      Till now block layer allowed two separate modes of request execution.
      A request is always acquired from the request queue via
      elv_next_request().  After that, drivers are free to either dequeue it
      or process it without dequeueing.  Dequeue allows elv_next_request()
      to return the next request so that multiple requests can be in flight.
      
      Executing requests without dequeueing has its merits mostly in
      allowing drivers for simpler devices which can't do sg to deal with
      segments only without considering request boundary.  However, the
      benefit this brings is dubious and declining while the cost of the API
      ambiguity is increasing.  Segment based drivers are usually for very
      old or limited devices and as converting to dequeueing model isn't
      difficult, it doesn't justify the API overhead it puts on block layer
      and its more modern users.
      
      Previous patches converted all block low level drivers to dequeueing
      model.  This patch completes the API transition by...
      
      * renaming elv_next_request() to blk_peek_request()
      
      * renaming blkdev_dequeue_request() to blk_start_request()
      
      * adding blk_fetch_request() which is combination of peek and start
      
      * disallowing completion of queued (not started) requests
      
      * applying new API to all LLDs
      
      Renamings are for consistency and to break out of tree code so that
      it's apparent that out of tree drivers need updating.
      
      [ Impact: block request issue API cleanup, no functional change ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: unsik Kim <donari75@gmail.com>
      Cc: Paul Clements <paul.clements@steeleye.com>
      Cc: Tim Waugh <tim@cyberelk.net>
      Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Laurent Vivier <Laurent@lvivier.info>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Cc: Borislav Petkov <petkovbb@googlemail.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Alex Dubov <oakad@yahoo.com>
      Cc: Pierre Ossman <drzeus@drzeus.cx>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
      Cc: Stefan Weinhuber <wein@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      9934c8c0
    • T
      block: blk_rq_[cur_]_{sectors|bytes}() usage cleanup · 1011c1b9
      Tejun Heo 提交于
      With the previous changes, the followings are now guaranteed for all
      requests in any valid state.
      
      * blk_rq_sectors() == blk_rq_bytes() >> 9
      * blk_rq_cur_sectors() == blk_rq_cur_bytes() >> 9
      
      Clean up accessor usages.  Notable changes are
      
      * nbd,i2o_block: end_all used instead of explicit byte count
      * scsi_lib: unnecessary conditional on request type removed
      
      [ Impact: cleanup ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Paul Clements <paul.clements@steeleye.com>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: Alex Dubov <oakad@yahoo.com>
      Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      1011c1b9
    • T
      block: cleanup rq->data_len usages · b0790410
      Tejun Heo 提交于
      With recent unification of fields, it's now guaranteed that
      rq->data_len always equals blk_rq_bytes().  Convert all non-IDE direct
      users to accessors.  IDE will be converted in a separate patch.
      
      Boaz: spotted incorrect data_len/resid_len conversion in osd.
      
      [ Impact: convert direct rq->data_len usages to blk_rq_bytes() ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
      Cc: Darrick J. Wong <djwong@us.ibm.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      b0790410
    • T
      block: convert to pos and nr_sectors accessors · 83096ebf
      Tejun Heo 提交于
      With recent cleanups, there is no place where low level driver
      directly manipulates request fields.  This means that the 'hard'
      request fields always equal the !hard fields.  Convert all
      rq->sectors, nr_sectors and current_nr_sectors references to
      accessors.
      
      While at it, drop superflous blk_rq_pos() < 0 test in swim.c.
      
      [ Impact: use pos and nr_sectors accessors ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Tested-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NAdrian McMenamin <adrian@mcmen.demon.co.uk>
      Acked-by: NAdrian McMenamin <adrian@mcmen.demon.co.uk>
      Acked-by: NMike Miller <mike.miller@hp.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Cc: Borislav Petkov <petkovbb@googlemail.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Paul Clements <paul.clements@steeleye.com>
      Cc: Tim Waugh <tim@cyberelk.net>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Alex Dubov <oakad@yahoo.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Dario Ballabio <ballabio_dario@emc.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: unsik Kim <donari75@gmail.com>
      Cc: Laurent Vivier <Laurent@lvivier.info>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      83096ebf
    • T
      block: implement blk_rq_pos/[cur_]sectors() and convert obvious ones · 5b93629b
      Tejun Heo 提交于
      Implement accessors - blk_rq_pos(), blk_rq_sectors() and
      blk_rq_cur_sectors() which return rq->hard_sector, rq->hard_nr_sectors
      and rq->hard_cur_sectors respectively and convert direct references of
      the said fields to the accessors.
      
      This is in preparation of request data length handling cleanup.
      
      Geert	: suggested adding const to struct request * parameter to accessors
      Sergei	: spotted error in patch description
      
      [ Impact: cleanup ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Acked-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Tested-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NGrant Likely <grant.likely@secretlab.ca>
      Ackec-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Cc: Borislav Petkov <petkovbb@googlemail.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      5b93629b
    • T
      block: add rq->resid_len · c3a4d78c
      Tejun Heo 提交于
      rq->data_len served two purposes - the length of data buffer on issue
      and the residual count on completion.  This duality creates some
      headaches.
      
      First of all, block layer and low level drivers can't really determine
      what rq->data_len contains while a request is executing.  It could be
      the total request length or it coulde be anything else one of the
      lower layers is using to keep track of residual count.  This
      complicates things because blk_rq_bytes() and thus
      [__]blk_end_request_all() relies on rq->data_len for PC commands.
      Drivers which want to report residual count should first cache the
      total request length, update rq->data_len and then complete the
      request with the cached data length.
      
      Secondly, it makes requests default to reporting full residual count,
      ie. reporting that no data transfer occurred.  The residual count is
      an exception not the norm; however, the driver should clear
      rq->data_len to zero to signify the normal cases while leaving it
      alone means no data transfer occurred at all.  This reverse default
      behavior complicates code unnecessarily and renders block PC on some
      drivers (ide-tape/floppy) unuseable.
      
      This patch adds rq->resid_len which is used only for residual count.
      
      While at it, remove now unnecessasry blk_rq_bytes() caching in
      ide_pc_intr() as rq->data_len is not changed anymore.
      
      Boaz	: spotted missing conversion in osd
      Sergei	: spotted too early conversion to blk_rq_bytes() in ide-tape
      
      [ Impact: cleanup residual count handling, report 0 resid by default ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Cc: Borislav Petkov <petkovbb@googlemail.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Doug Gilbert <dgilbert@interlog.com>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Darrick J. Wong <djwong@us.ibm.com>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      c3a4d78c
  12. 28 4月, 2009 2 次提交
    • T
      block: kill rq->data · 731ec497
      Tejun Heo 提交于
      Now that all block request data transfer is done via bio, rq->data
      isn't used.  Kill it.
      
      While at it, make the roles of rq->special and buffer clear.
      
      [ Impact: drop now unncessary field from struct request ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      731ec497
    • T
      block: implement and use [__]blk_end_request_all() · 40cbbb78
      Tejun Heo 提交于
      There are many [__]blk_end_request() call sites which call it with
      full request length and expect full completion.  Many of them ensure
      that the request actually completes by doing BUG_ON() the return
      value, which is awkward and error-prone.
      
      This patch adds [__]blk_end_request_all() which takes @rq and @error
      and fully completes the request.  BUG_ON() is added to to ensure that
      this actually happens.
      
      Most conversions are simple but there are a few noteworthy ones.
      
      * cdrom/viocd: viocd_end_request() replaced with direct calls to
        __blk_end_request_all().
      
      * s390/block/dasd: dasd_end_request() replaced with direct calls to
        __blk_end_request_all().
      
      * s390/char/tape_block: tapeblock_end_request() replaced with direct
        calls to blk_end_request_all().
      
      [ Impact: cleanup ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Alex Dubov <oakad@yahoo.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      40cbbb78
  13. 27 4月, 2009 1 次提交
  14. 03 4月, 2009 1 次提交
    • J
      [SCSI] fix recovered error handling · a9bddd74
      James Bottomley 提交于
      We have a problem with recovered error handling in that any command
      which goes down as BLOCK_PC but which returns a sense code of RECOVERED
      ERROR gets completed with -EIO.  For actual SG_IO commands, this doesn't
      matter at all, since the error return code gets dropped in favour of
      req->errors which contain the SCSI completion code.
      
      However, if this command is part of the block system, then it will pay
      attention to the returned error code.  In particularly if a SYNCHRONIZE
      CACHE from a barrier command completes with RECOVERED ERROR, the
      resulting -EIO on the barrier causes block to error the request and
      return it to the filesystem.  Fix this by converting the -EIO for
      recovered error to zero, plus remove the printing of this from sd and sr
      so the message isn't double printed.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      a9bddd74
  15. 13 3月, 2009 1 次提交
  16. 22 2月, 2009 1 次提交
  17. 08 1月, 2009 1 次提交
    • J
      [SCSI] scsi_lib: fix DID_RESET status problems · 79ed2429
      James Bottomley 提交于
      Andrew Vaszquez said:
      > There's a problem that is causing commands returned by the LLD with
      > a DID_RESET status to be reissued with cleared cmd->sdb data which
      > in our tests are manifesting in firmware detected overruns.  Here's
      > a snippet of a READ_10 scsi_cmnd upon completion by the storage
      
      The problem is caused by:
      
      commit b60af5b0
      Author: Alan Stern <stern@rowland.harvard.edu>
      Date:   Mon Nov 3 15:56:47 2008 -0500
      
          [SCSI] simplify scsi_io_completion()
      
      Because scsi_release_buffers() is called before commands that go
      through the ACTION_RETRY and ACTION_DELAYED_RETRY legs are requeued.
      However, they're not re-prepared, so nothing ever reallocates the
      buffer resources to them.  Fix this by releasing the buffers only if
      we're not going to go down these legs (but scsi_release_buffers() on
      all legs including two in scsi_end_request(); this latter needs a
      special version __scsi_release_buffers() because the final one can be
      called after the request has been freed, so the bidi test in
      scsi_release_buffers(), which touches the request has to be skipped).
      Reported-by: NAndrew Vasquez <andrew.vasquez@qlogic.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      79ed2429
  18. 05 1月, 2009 2 次提交
    • M
      [SCSI] Fix error handling for DIF/DIX · 3e695f89
      Martin K. Petersen 提交于
      patch
      
      commit b60af5b0
      Author: Alan Stern <stern@rowland.harvard.edu>
      Date:   Mon Nov 3 15:56:47 2008 -0500
      
          [SCSI] simplify scsi_io_completion()
      
      broke DIX error handling.  Also, we are now using EILSEQ to indicate
      integrity errors to the upper layers (as opposed to regular EIO
      failures).  This allows filesystems to inspect buffers and decide
      whether to retry the I/O.  Update scsi_io_completion() accordingly.
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      3e695f89
    • J
      [SCSI] scsi_lib: don't decrement busy counters when inserting commands · 4f5299ac
      James Bottomley 提交于
      A bug was introduced by
      
      commit b60af5b0
      Author: Alan Stern <stern@rowland.harvard.edu>
      Date:   Mon Nov 3 15:56:47 2008 -0500
      
          [SCSI] simplify scsi_io_completion()
       
      because the simplification uses scsi_queue_insert().  The problem with
      this function is that it expects to be called from the completion path
      while the command is still outstanding, so it decrements the device
      and host busy counts to do the requeue.  The problem is that
      scsi_io_completion() is a path executed well after these counts have
      *already* been decremented, leading to a double decrement if the
      command goes down any error path leading to ACTION_DELAYED_RETRY.
      
      The fix is to allow a private function __scsi_queue_insert() with a
      flag to say whether the busy counters should be decremented.  This is
      made static to scsi_lib.c to discourage other use.
      Reported-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      4f5299ac
  19. 03 1月, 2009 1 次提交
  20. 30 12月, 2008 2 次提交
    • F
      [SCSI] add residual argument to scsi_execute and scsi_execute_req · f4f4e47e
      FUJITA Tomonori 提交于
      scsi_execute() and scsi_execute_req() discard the residual length
      information. Some callers need it. This adds residual argument
      (optional) to scsi_execute and scsi_execute_req.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      f4f4e47e
    • A
      [SCSI] simplify scsi_io_completion() · b60af5b0
      Alan Stern 提交于
      This patch (as1142b) consolidates a lot of repetitious code in
      scsi_io_completion().  It also fixes a few comments.  Most
      importantly, however, it clearly distinguishes among the three sorts
      of retries that can be done when a command fails to complete:
      
      	Unprepare the request and resubmit it, so that a new
      	command will be created for it.
      
      	Requeue the request directly so that it will be retried
      	immediately using the same command.
      
      	Requeue the request so that it will be retried following
      	a short delay.
      
      	Complete the remainder of the request with an I/O error.
      
      [jejb: Updates
           1. For several error conditions, we would now print the sense twice
              in slightly different ways, so unify the location of sense
              printing.
           2. I added more descriptions to actual failure conditions for
              better debugging
           3. according to spec, ABORTED_COMMAND is supposed to be retried
              (except on DIF failure).  Our old behaviour of erroring it looks
              to be a bug.
           4. I'd prefer not to default initialise the action variable because
              that ensures that every leg of the error handler has an
              associated action and the compiler will warn if someone later
              accidentally misses one or removes one.
      ]
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      b60af5b0
  21. 14 12月, 2008 1 次提交
  22. 16 11月, 2008 1 次提交
  23. 24 10月, 2008 3 次提交
  24. 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
  25. 09 10月, 2008 1 次提交
  26. 04 10月, 2008 1 次提交
  27. 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
  28. 27 7月, 2008 1 次提交