1. 06 Nov, 2015 1 commit
  2. 05 May, 2015 1 commit
  3. 28 Aug, 2014 1 commit
    • Joe Lawrence's avatar
      block,scsi: fixup blk_get_request dead queue scenarios · a492f075
      Joe Lawrence authored
      The blk_get_request function may fail in low-memory conditions or during
      device removal (even if __GFP_WAIT is set). To distinguish between these
      errors, modify the blk_get_request call stack to return the appropriate
      ERR_PTR. Verify that all callers check the return status and consider
      IS_ERR instead of a simple NULL pointer check.
      For consistency, make a similar change to the blk_mq_alloc_request leg
      of blk_get_request.  It may fail if the queue is dead, or the caller was
      unwilling to wait.
      Signed-off-by: default avatarJoe Lawrence <joe.lawrence@stratus.com>
      Acked-by: Jiri Kosina <jkosina@suse.cz> [for pktdvd]
      Acked-by: Boaz Harrosh <bharrosh@panasas.com> [for osd]
      Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
  4. 05 Sep, 2013 1 commit
  5. 10 Mar, 2011 1 commit
  6. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      The script does the followings.
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
      The conversion was done in the following steps.
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
      6. percpu.h was updated not to include slab.h.
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
  7. 27 Apr, 2009 1 commit
  8. 18 Apr, 2009 1 commit
  9. 08 Apr, 2009 1 commit
  10. 27 Mar, 2009 4 commits
  11. 24 Mar, 2009 1 commit
  12. 06 Jan, 2009 1 commit
  13. 02 Jan, 2009 2 commits
    • Bartlomiej Zolnierkiewicz's avatar
      ide: use per-device request queue locks (v2) · 201bffa4
      Bartlomiej Zolnierkiewicz authored
      * Move hack for flush requests from choose_drive() to do_ide_request().
      * Add ide_plug_device() helper and convert core IDE code from using
        per-hwgroup lock as a request lock to use the ->queue_lock instead.
      * Remove no longer needed:
        - choose_drive() function
        - WAKEUP() macro
        - 'sleeping' flag from ide_hwif_t
        - 'service_{start,time}' fields from ide_drive_t
      This patch results in much simpler and more maintainable code
      (besides being a scalability improvement).
      * Fixes/improvements based on review from Elias:
        - take as many requests off the queue as possible
        - remove now redundant BUG_ON()
      Cc: Elias Oltmanns <eo@nebensachen.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: add ide_[un]lock_hwgroup() helpers · 631de370
      Bartlomiej Zolnierkiewicz authored
      Add ide_[un]lock_hwgroup() inline helpers for obtaining exclusive
      access to the given hwgroup and update the core code accordingly.
      [ This change besides making code saner results in more efficient
        use of ide_{get,release}_lock(). ]
      Cc: Michael Schmitz <schmitz@biophys.uni-duesseldorf.de>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Elias Oltmanns <eo@nebensachen.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  14. 29 Dec, 2008 1 commit
  15. 13 Oct, 2008 1 commit
    • Elias Oltmanns's avatar
      ide: Implement disk shock protection support (v4) · 4abdc6ee
      Elias Oltmanns authored
      On user request (through sysfs), the IDLE IMMEDIATE command with UNLOAD
      FEATURE as specified in ATA-7 is issued to the device and processing of
      the request queue is stopped thereafter until the specified timeout
      expires or user space asks to resume normal operation. This is supposed
      to prevent the heads of a hard drive from accidentally crashing onto the
      platter when a heavy shock is anticipated (like a falling laptop expected
      to hit the floor). Port resets are deferred whenever a device on that
      port is in the parked state.
      Elias Oltmanns <eo@nebensachen.de> wrote:
      > >> 1. Make sure that no negative value is being passed to
      > >>    jiffies_to_msecs() in ide_park_show().
      > >> 2. Drop the superfluous variable hwif in ide_special_rq().
      > >> 3. Skip initialisation of task and tf in ide_special_rq() if we are not
      > >>    handling a (un)park request.
      > >
      > > Well, #3 should have been done differently because we donn't want to
      > > check for REQ_(UN)?PARK_HEADS more often than is necessary.
      > While preparing the backport to 2.6.27, it has just occurred to me that
      > we need to clear the IDE_DFLAG_PARKED flag in ide_disk_pre_reset()
      > because this flag must not be set after *any* sort of access to the
      > device.
      Fix a memory leak due to a missing blk_put_request() in
      issue_park_cmd(). Additionally, we should plug the queue when enqueueing
      the unpark request because there is no guarantee that the park timeout
      has not expired by then. Even though the chance for that to happen is
      very slim, the request might end up hanging in the queue until the next
      I/O operation is queued up. While at it, clean up the code a little:
      - make issue_park_cmd() a function of type void since nobody cares for
        the return value anyway;
      - use blk_start_queueing() instead of __blk_run_queue() since we don't
        have to worry about recursion;
      - remove a superfluous pointer deference in task_no_data_intr().
      Signed-off-by: default avatarElias Oltmanns <eo@nebensachen.de>
      Cc: Jeff Garzik <jeff@garzik.org>,
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>