1. Feb 26, 2011
    • Greg Thelen's avatar
      mm: grab rcu read lock in move_pages() · a879bf58
      Greg Thelen authored
      The move_pages() usage of find_task_by_vpid() requires rcu_read_lock() to
      prevent free_pid() from reclaiming the pid.
      
      Without this patch, RCU warnings are printed in v2.6.38-rc4 move_pages()
      with:
      
        CONFIG_LOCKUP_DETECTOR=y
        CONFIG_PREEMPT=y
        CONFIG_LOCKDEP=y
        CONFIG_PROVE_LOCKING=y
        CONFIG_PROVE_RCU=y
      
      Previously, migrate_pages() went through a similar transformation
      replacing usage of tasklist_lock with rcu read lock:
      
        commit 55cfaa3c
        Author: Zeng Zhaoming <zengzm.kernel@gmail.com>
        Date:   Thu Dec 2 14:31:13 2010 -0800
      
            mm/mempolicy.c: add rcu read lock to protect pid structure
      
        commit 1e50df39
      
      
        Author: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
        Date:   Thu Jan 13 15:46:14 2011 -0800
      
            mempolicy: remove tasklist_lock from migrate_pages
      
      Signed-off-by: default avatarGreg Thelen <gthelen@google.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: Minchan Kim <minchan.kim@gmail.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a879bf58
    • Davide Libenzi's avatar
      epoll: prevent creating circular epoll structures · 22bacca4
      Davide Libenzi authored
      
      
      In several places, an epoll fd can call another file's ->f_op->poll()
      method with ep->mtx held.  This is in general unsafe, because that other
      file could itself be an epoll fd that contains the original epoll fd.
      
      The code defends against this possibility in its own ->poll() method using
      ep_call_nested, but there are several other unsafe calls to ->poll
      elsewhere that can be made to deadlock.  For example, the following simple
      program causes the call in ep_insert recursively call the original fd's
      ->poll, leading to deadlock:
      
       #include <unistd.h>
       #include <sys/epoll.h>
      
       int main(void) {
           int e1, e2, p[2];
           struct epoll_event evt = {
               .events = EPOLLIN
           };
      
           e1 = epoll_create(1);
           e2 = epoll_create(2);
           pipe(p);
      
           epoll_ctl(e2, EPOLL_CTL_ADD, e1, &evt);
           epoll_ctl(e1, EPOLL_CTL_ADD, p[0], &evt);
           write(p[1], p, sizeof p);
           epoll_ctl(e1, EPOLL_CTL_ADD, e2, &evt);
      
           return 0;
       }
      
      On insertion, check whether the inserted file is itself a struct epoll,
      and if so, do a recursive walk to detect whether inserting this file would
      create a loop of epoll structures, which could lead to deadlock.
      
      [nelhage@ksplice.com: Use epmutex to serialize concurrent inserts]
      Signed-off-by: default avatarDavide Libenzi <davidel@xmailserver.org>
      Signed-off-by: default avatarNelson Elhage <nelhage@ksplice.com>
      Reported-by: default avatarNelson Elhage <nelhage@ksplice.com>
      Tested-by: default avatarNelson Elhage <nelhage@ksplice.com>
      Cc: <stable@kernel.org>		[2.6.34+, possibly earlier]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      22bacca4
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6 · 6366213e
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
        regulator, mc13xxx: Remove pointless test for unsigned less than zero
        regulator: Fix warning with CONFIG_BUG disabled
      6366213e
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable · 4660ba63
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
        Btrfs: fix fiemap bugs with delalloc
        Btrfs: set FMODE_EXCL in btrfs_device->mode
        Btrfs: make btrfs_rm_device() fail gracefully
        Btrfs: Avoid accessing unmapped kernel address
        Btrfs: Fix BTRFS_IOC_SUBVOL_SETFLAGS ioctl
        Btrfs: allow balance to explicitly allocate chunks as it relocates
        Btrfs: put ENOSPC debugging under a mount option
      4660ba63
    • Linus Torvalds's avatar
      Merge branch 'x86-fixes-for-linus' of... · 958ede7f
      Linus Torvalds authored
      Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
        x86 quirk: Fix polarity for IRQ0 pin2 override on SB800 systems
        x86/mrst: Fix apb timer rating when lapic timer is used
        x86: Fix reboot problem on VersaLogic Menlow boards
      958ede7f
    • Jelle Martijn Kok's avatar
      RTC: fix typo in drivers/rtc/rtc-at91sam9.c · d4035850
      Jelle Martijn Kok authored
      
      
      The member of the rtc_class_ops struct is called alarm_irq_enable and
      not alarm_irq_enabled
      
      CC: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarJelle Martijn Kok <jmkok@youcom.nl>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d4035850
    • Linus Torvalds's avatar
      Merge branch 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 · c1bc3beb
      Linus Torvalds authored
      * 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
        usb: musb: core: set has_tt flag
        USB: xhci: mark local functions as static
        USB: xhci: fix couple sparse annotations
        USB: xhci: rework xhci_print_ir_set() to get ir set from xhci itself
        USB: Reset USB 3.0 devices on (re)discovery
        xhci: Fix an error in count_sg_trbs_needed()
        xhci: Fix errors in the running total calculations in the TRB math
        xhci: Clarify some expressions in the TRB math
        xhci: Avoid BUG() in interrupt context
      c1bc3beb
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://neil.brown.name/md · 638691a7
      Linus Torvalds authored
      * 'for-linus' of git://neil.brown.name/md:
        md: Fix - again - partition detection when array becomes active
        Fix over-zealous flush_disk when changing device size.
        md: avoid spinlock problem in blk_throtl_exit
        md: correctly handle probe of an 'mdp' device.
        md: don't set_capacity before array is active.
        md: Fix raid1->raid0 takeover
      638691a7
    • Anton Blanchard's avatar
      RxRPC: Allocate tokens with kzalloc to avoid oops in rxrpc_destroy · 0a93ea2e
      Anton Blanchard authored
      
      
      With slab poisoning enabled, I see the following oops:
      
        Unable to handle kernel paging request for data at address 0x6b6b6b6b6b6b6b73
        ...
        NIP [c0000000006bc61c] .rxrpc_destroy+0x44/0x104
        LR [c0000000006bc618] .rxrpc_destroy+0x40/0x104
        Call Trace:
        [c0000000feb2bc00] [c0000000006bc618] .rxrpc_destroy+0x40/0x104 (unreliable)
        [c0000000feb2bc90] [c000000000349b2c] .key_cleanup+0x1a8/0x20c
        [c0000000feb2bd40] [c0000000000a2920] .process_one_work+0x2f4/0x4d0
        [c0000000feb2be00] [c0000000000a2d50] .worker_thread+0x254/0x468
        [c0000000feb2bec0] [c0000000000a868c] .kthread+0xbc/0xc8
        [c0000000feb2bf90] [c000000000020e00] .kernel_thread+0x54/0x70
      
      We aren't initialising token->next, but the code in destroy_context relies
      on the list being NULL terminated. Use kzalloc to zero out all the fields.
      
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: Linus Torvalds <torvalds...
      0a93ea2e
    • Anton Blanchard's avatar
      afs: Fix oops in afs_unlink_writeback · f129ccc9
      Anton Blanchard authored
      I'm seeing the following oops when testing afs:
      
        Unable to handle kernel paging request for data at address 0x00000008
        ...
        NIP [c0000000003393b0] .afs_unlink_writeback+0x38/0xc0
        LR [c00000000033987c] .afs_put_writeback+0x98/0xec
        Call Trace:
        [c00000000345f600] [c00000000033987c] .afs_put_writeback+0x98/0xec
        [c00000000345f690] [c00000000033ae80] .afs_write_begin+0x6a4/0x75c
        [c00000000345f790] [c00000000012b77c] .generic_file_buffered_write+0x148/0x320
        [c00000000345f8d0] [c00000000012e1b8] .__generic_file_aio_write+0x37c/0x3e4
        [c00000000345f9d0] [c00000000012e2a8] .generic_file_aio_write+0x88/0xfc
        [c00000000345fa90] [c0000000003390a8] .afs_file_write+0x10c/0x178
        [c00000000345fb40] [c000000000188788] .do_sync_write+0xc4/0x128
        [c00000000345fcc0] [c000000000189658] .vfs_write+0xe8/0x1d8
        [c00000000345fd70] [c000000000189884] .SyS_write+0x68/0xb0
        [c00000000345fe30] [c000000000008564] syscall_exit+0x0/0x40
      
      afs_write_begin hits an error and calls ...
      f129ccc9
  2. Feb 25, 2011
  3. Feb 24, 2011