1. 12 Sep, 2011 7 commits
  2. 11 Sep, 2011 25 commits
  3. 10 Sep, 2011 8 commits
    • Janusz Krzysztofik's avatar
      ARM: 7088/1: entry: fix wrong parameter name used in do_thumb_abort · 6c6d8deb
      Janusz Krzysztofik authored
      Commit be020f86, "ARM: entry: abort-macro: specify registers to be
      used for macros", while replacing register numbers with macro parameter
      names, mismatched the name used for r1. For me, this resulted in user
      space built for EABI with -march=armv4t -mtune=arm920t -mthumb-interwork
      -mthumb broken on my OMAP1510 based Amstrad Delta (old ABI and no thumb
      still worked for me though).
      
      Fix this by using correct parameter name fsr instead of mismatched psr,
      used by callers for another purpose.
      Signed-off-by: default avatarJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      6c6d8deb
    • Arnd Bergmann's avatar
    • Bart Van Assche's avatar
      backlight: Declare backlight_types[] const · c338bfb5
      Bart Van Assche authored
      Since backlight_types[] isn't modified, let's declare it const.  That
      was probably the intention of the author of commit bb7ca747
      ("backlight: add backlight type"), via which the "const char const *"
      construct was introduced.  The duplicate const was detected by sparse.
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Cc: Matthew Garrett <mjg@redhat.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c338bfb5
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://neil.brown.name/md · 290a1cc4
      Linus Torvalds authored
      * 'for-linus' of git://neil.brown.name/md:
        md: Fix handling for devices from 2TB to 4TB in 0.90 metadata.
        md/raid1,10: Remove use-after-free bug in make_request.
        md/raid10: unify handling of write completion.
        Avoid dereferencing a 'request_queue' after last close.
      290a1cc4
    • NeilBrown's avatar
      md: Fix handling for devices from 2TB to 4TB in 0.90 metadata. · 27a7b260
      NeilBrown authored
      0.90 metadata uses an unsigned 32bit number to count the number of
      kilobytes used from each device.
      This should allow up to 4TB per device.
      However we multiply this by 2 (to get sectors) before casting to a
      larger type, so sizes above 2TB get truncated.
      
      Also we allow rdev->sectors to be larger than 4TB, so it is possible
      for the array to be resized larger than the metadata can handle.
      So make sure rdev->sectors never exceeds 4TB when 0.90 metadata is in
      used.
      
      Also the sanity check at the end of super_90_load should include level
      1 as it used ->size too. (RAID0 and Linear don't use ->size at all).
      Reported-by: default avatarPim Zandbergen <P.Zandbergen@macroscoop.nl>
      Cc: stable@kernel.org
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      27a7b260
    • NeilBrown's avatar
      md/raid1,10: Remove use-after-free bug in make_request. · 079fa166
      NeilBrown authored
      A single request to RAID1 or RAID10 might result in multiple
      requests if there are known bad blocks that need to be avoided.
      
      To detect if we need to submit another write request we test:
       	if (sectors_handled < (bio->bi_size >> 9)) {
      
      However this is after we call **_write_done() so the 'bio' no longer
      belongs to us - the writes could have completed and the bio freed.
      
      So move the **_write_done call until after the test against
      bio->bi_size.
      
      This addresses https://bugzilla.kernel.org/show_bug.cgi?id=41862Reported-by: default avatarBruno Wolff III <bruno@wolff.to>
      Tested-by: default avatarBruno Wolff III <bruno@wolff.to>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      079fa166
    • NeilBrown's avatar
      md/raid10: unify handling of write completion. · 19d5f834
      NeilBrown authored
      A write can complete at two different places:
      1/ when the last member-device write completes, through
         raid10_end_write_request
      2/ in make_request() when we remove the initial bias from ->remaining.
      
      These two should do exactly the same thing and the comment says they
      do, but they don't.
      
      So factor the correct code out into a function and call it in both
      places.  This makes the code much more similar to RAID1.
      
      The difference is only significant if there is an error, and they
      usually take a while, so it is unlikely that there will be an error
      already when make_request is completing, so this is unlikely to cause
      real problems.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      19d5f834
    • 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