Skip to content
  1. Sep 10, 2011
    • NeilBrown's avatar
      Avoid dereferencing a 'request_queue' after last close. · 94007751
      NeilBrown authored
      On the last close of an 'md' device which as been stopped, the device
      is destroyed and in particular the request_queue is freed.  The free
      is done in a separate thread so it might happen a short time later.
      
      __blkdev_put calls bdev_inode_switch_bdi *after* ->release has been
      called.
      
      Since commit f758eeab
      
      
      bdev_inode_switch_bdi will dereference the 'old' bdi, which lives
      inside a request_queue, to get a spin lock.  This causes the last
      close on an md device to sometime take a spin_lock which lives in
      freed memory - which results in an oops.
      
      So move the called to bdev_inode_switch_bdi before the call to
      ->release.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Acked-by: default avatarWu Fengguang <fengguang.wu@intel.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      94007751
  2. Aug 31, 2011
    • NeilBrown's avatar
      md/raid5: fix a hang on device failure. · 43220aa0
      NeilBrown authored
      
      
      Waiting for a 'blocked' rdev to become unblocked in the raid5d thread
      cannot work with internal metadata as it is the raid5d thread which
      will clear the blocked flag.
      This wasn't a problem in 3.0 and earlier as we only set the blocked
      flag when external metadata was used then.
      However we now set it always, so we need to be more careful.
      
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      43220aa0
  3. Aug 30, 2011
  4. Aug 25, 2011
  5. Aug 24, 2011
  6. Aug 23, 2011
  7. Aug 22, 2011
  8. Aug 21, 2011
  9. Aug 20, 2011
    • Julia Lawall's avatar
      ALSA: sound/aoa/fabrics/layout.c: remove unneeded kfree · de75577c
      Julia Lawall authored
      The label outnodev is only used when kzalloc has not yet taken place or has
      failed, so there is no need for the call for kfree under this label.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/
      
      )
      
      // <smpl>
      @@
      identifier x;
      expression E1!=0,E2,E3,E4;
      statement S;
      iterator I;
      @@
      
      (
      if (...) { ... when != kfree(x)
                     when != x = E3
                     when != E3 = x
      *  return ...;
       }
      ... when != x = E2
          when != I(...,x,...) S
      if (...) { ... when != x = E4
       kfree(x); ... return ...; }
      )
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      de75577c
    • Takashi Iwai's avatar
      ALSA: hda - Fix error check from snd_hda_get_conn_index() in patch_cirrus.c · 1b004d03
      Takashi Iwai authored
      
      
      snd_hda_get_conn_index() returns a negative value while the current code
      stores it in an unsigned int.  It must be stored in a signed integer.
      
      Reported-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      1b004d03
    • Takashi Iwai's avatar
      ALSA: hda - Don't spew too many ELD errors · b6acf013
      Takashi Iwai authored
      
      
      Currently HD-audio driver shows the all error ELD byte as an error
      in the kernel message.  This is annoying when the video driver doesn't
      set the correct ELD from the beginning. e.g. radeon sends a zero-byte
      data, but we still check ELD with the fixed 128 byte as a workaround
      for some broken devices, it spews 128-times errors.
      
      For avoiding this, the driver aborts reading when the first byte is
      invalid.  In such a case, the whole data is certainly invalid.
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b6acf013
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/drm-intel · bed8cad9
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/drm-intel:
        drm/i915: set GFX_MODE to pre-Ivybridge default value even on Ivybridge
      bed8cad9
    • Jiaying Zhang's avatar
      ext4: flush any pending end_io requests before DIO reads w/dioread_nolock · dccaf33f
      Jiaying Zhang authored
      
      
      There is a race between ext4 buffer write and direct_IO read with
      dioread_nolock mount option enabled. The problem is that we clear
      PageWriteback flag during end_io time but will do
      uninitialized-to-initialized extent conversion later with dioread_nolock.
      If an O_direct read request comes in during this period, ext4 will return
      zero instead of the recently written data.
      
      This patch checks whether there are any pending uninitialized-to-initialized
      extent conversion requests before doing O_direct read to close the race.
      Note that this is just a bandaid fix. The fundamental issue is that we
      clear PageWriteback flag before we really complete an IO, which is
      problem-prone. To fix the fundamental issue, we may need to implement an
      extent tree cache that we can use to look up pending to-be-converted extents.
      
      Signed-off-by: default avatarJiaying Zhang <jiayingz@google.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@kernel.org
      dccaf33f
    • Jesse Barnes's avatar
      drm/i915: set GFX_MODE to pre-Ivybridge default value even on Ivybridge · b095cd0a
      Jesse Barnes authored
      
      
      Prior to Ivybridge, the GFX_MODE would default to 0x800, meaning that
      MI_FLUSH would flush the TLBs in addition to the rest of the caches
      indicated in the MI_FLUSH command.  However starting with Ivybridge, the
      register defaults to 0x2800 out of reset, meaning that to invalidate the
      TLB we need to use PIPE_CONTROL.  Since we're not doing that yet, go
      back to the old default so things work.
      
      v2: don't forget to actually *clear* the new bit
      
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: default avatarKenneth Graunke <kenneth@whitecape.org>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      b095cd0a
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 5ccc3874
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.dk/linux-block: (23 commits)
        Revert "cfq: Remove special treatment for metadata rqs."
        block: fix flush machinery for stacking drivers with differring flush flags
        block: improve rq_affinity placement
        blktrace: add FLUSH/FUA support
        Move some REQ flags to the common bio/request area
        allow blk_flush_policy to return REQ_FSEQ_DATA independent of *FLUSH
        xen/blkback: Make description more obvious.
        cfq-iosched: Add documentation about idling
        block: Make rq_affinity = 1 work as expected
        block: swim3: fix unterminated of_device_id table
        block/genhd.c: remove useless cast in diskstats_show()
        drivers/cdrom/cdrom.c: relax check on dvd manufacturer value
        drivers/block/drbd/drbd_nl.c: use bitmap_parse instead of __bitmap_parse
        bsg-lib: add module.h include
        cfq-iosched: Reduce linked group count upon group destruction
        blk-throttle: correctly determine sync bio
        loop: fix deadlock when sysfs and LOOP_CLR_FD race against each other
        loop: add BLK_DEV_LOOP_MIN_COUNT=%i to allow distros 0 pre-allocated loop devices
        loop: add management interface for on-demand device allocation
        loop: replace linked list of allocated devices with an idr index
        ...
      5ccc3874