1. 09 12月, 2010 1 次提交
    • J
      [SCSI] Eliminate error handler overload of the SCSI serial number · 459dbf72
      James Bottomley 提交于
      The error handler is using the test cmd->serial_number == 0 in the
      abort routines to signal that the command to be aborted has already
      completed normally.  This design was to close a race window in the
      original error handler where a command could go through the normal
      completion routines after it timed out but before error handling was
      started.
      
      Mike Anderson pointed out that when we converted our timeout and
      softirq completions, we picked up atomicity here because the block
      layer now mediates this with the REQ_ATOM_COMPLETE flag and guarantees
      that *either* the command times out or our done routine is called, but
      ensures we can't get both occurring.  That makes the serial number
      zero check redundant and it can be removed.
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      459dbf72
  2. 25 10月, 2010 1 次提交
    • M
      [SCSI] Fix regressions in scsi_internal_device_block · 986fe6c7
      Mike Christie 提交于
      Deleting a SCSI device on a blocked fc_remote_port (before
      fast_io_fail_tmo fires) results in a hanging thread:
      
        STACK:
        0 schedule+1108 [0x5cac48]
        1 schedule_timeout+528 [0x5cb7fc]
        2 wait_for_common+266 [0x5ca6be]
        3 blk_execute_rq+160 [0x354054]
        4 scsi_execute+324 [0x3b7ef4]
        5 scsi_execute_req+162 [0x3b80ca]
        6 sd_sync_cache+138 [0x3cf662]
        7 sd_shutdown+138 [0x3cf91a]
        8 sd_remove+112 [0x3cfe4c]
        9 __device_release_driver+124 [0x3a08b8]
      10 device_release_driver+60 [0x3a0a5c]
      11 bus_remove_device+266 [0x39fa76]
      12 device_del+340 [0x39d818]
      13 __scsi_remove_device+204 [0x3bcc48]
      14 scsi_remove_device+66 [0x3bcc8e]
      15 sysfs_schedule_callback_work+50 [0x260d66]
      16 worker_thread+622 [0x162326]
      17 kthread+160 [0x1680b0]
      18 kernel_thread_starter+6 [0x10aaea]
      
      During the delete, the SCSI device is in moved to SDEV_CANCEL.  When
      the FC transport class later calls scsi_target_unblock, this has no
      effect, since scsi_internal_device_unblock ignores SCSI devics in this
      state.
      
      It looks like all these are regressions caused by:
      5c10e63c
      [SCSI] limit state transitions in scsi_internal_device_unblock
      
      Fix by rejecting offline and cancel in the state transition.
      Signed-off-by: NChristof Schmitt <christof.schmitt@de.ibm.com>
      [jejb: Original patch by Christof Schmitt, modified by Mike Christie]
      Cc: Stable Tree <stable@kernel.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      986fe6c7
  3. 11 9月, 2010 1 次提交
  4. 09 9月, 2010 1 次提交
  5. 11 8月, 2010 1 次提交
  6. 08 8月, 2010 3 次提交
  7. 26 2月, 2010 2 次提交
  8. 19 1月, 2010 1 次提交
    • D
      [SCSI] skip sense logging for some ATA PASS-THROUGH cdbs · e7efe593
      Douglas Gilbert 提交于
      Further to the lsml thread titled:
      "does scsi_io_completion need to dump sense data for ata pass through (ck_cond =
      1) ?"
      
      This is a patch to skip logging when the sense data is
      associated with a SENSE_KEY of "RECOVERED_ERROR" and the
      additional sense code is "ATA PASS-THROUGH INFORMATION
      AVAILABLE". This only occurs with the SAT ATA PASS-THROUGH
      commands when CK_COND=1 (in the cdb). It indicates that
      the sense data contains ATA registers.
      
      Smartmontools uses such commands on ATA disks connected via
      SAT. Periodic checks such as those done by smartd cause
      nuisance entries into logs that are:
          - neither errors nor warnings
          - pointless unless the cdb that caused them are also logged
      Signed-off-by: NDouglas Gilbert <dgilbert@interlog.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      e7efe593
  9. 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
  10. 10 12月, 2009 1 次提交
  11. 05 12月, 2009 1 次提交
  12. 30 10月, 2009 1 次提交
  13. 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
  14. 23 8月, 2009 1 次提交
  15. 22 6月, 2009 1 次提交
  16. 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
  17. 20 5月, 2009 1 次提交
  18. 12 5月, 2009 1 次提交
  19. 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
  20. 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
  21. 27 4月, 2009 1 次提交
  22. 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
  23. 13 3月, 2009 1 次提交
  24. 22 2月, 2009 1 次提交
  25. 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
  26. 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
  27. 03 1月, 2009 1 次提交
  28. 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