1. 26 Dec, 2012 9 commits
  2. 25 Dec, 2012 1 commit
  3. 22 Dec, 2012 3 commits
  4. 21 Dec, 2012 27 commits
    • Gao feng's avatar
      bridge: call br_netpoll_disable in br_add_if · 9b1536c4
      Gao feng authored
      When netdev_set_master faild in br_add_if, we should
      call br_netpoll_disable to do some cleanup jobs,such
      as free the memory of struct netpoll which allocated
      in br_netpoll_enable.
      Signed-off-by: default avatarGao feng <gaofeng@cn.fujitsu.com>
      Acked-by: default avatarCong Wang <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9b1536c4
    • Eric Dumazet's avatar
      ipv4: arp: fix a lockdep splat in arp_solicit() · 9650388b
      Eric Dumazet authored
      Yan Burman reported following lockdep warning :
      
      =============================================
      [ INFO: possible recursive locking detected ]
      3.7.0+ #24 Not tainted
      ---------------------------------------------
      swapper/1/0 is trying to acquire lock:
        (&n->lock){++--..}, at: [<ffffffff8139f56e>] __neigh_event_send
      +0x2e/0x2f0
      
      but task is already holding lock:
        (&n->lock){++--..}, at: [<ffffffff813f63f4>] arp_solicit+0x1d4/0x280
      
      other info that might help us debug this:
        Possible unsafe locking scenario:
      
              CPU0
              ----
         lock(&n->lock);
         lock(&n->lock);
      
        *** DEADLOCK ***
      
        May be due to missing lock nesting notation
      
      4 locks held by swapper/1/0:
        #0:  (((&n->timer))){+.-...}, at: [<ffffffff8104b350>]
      call_timer_fn+0x0/0x1c0
        #1:  (&n->lock){++--..}, at: [<ffffffff813f63f4>] arp_solicit
      +0x1d4/0x280
        #2:  (rcu_read_lock_bh){.+....}, at: [<ffffffff81395400>]
      dev_queue_xmit+0x0/0x5d0
        #3:  (rcu_read_lock_bh){.+....}, at: [<ffffffff813cb41e>]
      ip_finish_output+0x13e/0x640
      
      stack backtrace:
      Pid: 0, comm: swapper/1 Not tainted 3.7.0+ #24
      Call Trace:
        <IRQ>  [<ffffffff8108c7ac>] validate_chain+0xdcc/0x11f0
        [<ffffffff8108d570>] ? __lock_acquire+0x440/0xc30
        [<ffffffff81120565>] ? kmem_cache_free+0xe5/0x1c0
        [<ffffffff8108d570>] __lock_acquire+0x440/0xc30
        [<ffffffff813c3570>] ? inet_getpeer+0x40/0x600
        [<ffffffff8108d570>] ? __lock_acquire+0x440/0xc30
        [<ffffffff8139f56e>] ? __neigh_event_send+0x2e/0x2f0
        [<ffffffff8108ddf5>] lock_acquire+0x95/0x140
        [<ffffffff8139f56e>] ? __neigh_event_send+0x2e/0x2f0
        [<ffffffff8108d570>] ? __lock_acquire+0x440/0xc30
        [<ffffffff81448d4b>] _raw_write_lock_bh+0x3b/0x50
        [<ffffffff8139f56e>] ? __neigh_event_send+0x2e/0x2f0
        [<ffffffff8139f56e>] __neigh_event_send+0x2e/0x2f0
        [<ffffffff8139f99b>] neigh_resolve_output+0x16b/0x270
        [<ffffffff813cb62d>] ip_finish_output+0x34d/0x640
        [<ffffffff813cb41e>] ? ip_finish_output+0x13e/0x640
        [<ffffffffa046f146>] ? vxlan_xmit+0x556/0xbec [vxlan]
        [<ffffffff813cb9a0>] ip_output+0x80/0xf0
        [<ffffffff813ca368>] ip_local_out+0x28/0x80
        [<ffffffffa046f25a>] vxlan_xmit+0x66a/0xbec [vxlan]
        [<ffffffffa046f146>] ? vxlan_xmit+0x556/0xbec [vxlan]
        [<ffffffff81394a50>] ? skb_gso_segment+0x2b0/0x2b0
        [<ffffffff81449355>] ? _raw_spin_unlock_irqrestore+0x65/0x80
        [<ffffffff81394c57>] ? dev_queue_xmit_nit+0x207/0x270
        [<ffffffff813950c8>] dev_hard_start_xmit+0x298/0x5d0
        [<ffffffff813956f3>] dev_queue_xmit+0x2f3/0x5d0
        [<ffffffff81395400>] ? dev_hard_start_xmit+0x5d0/0x5d0
        [<ffffffff813f5788>] arp_xmit+0x58/0x60
        [<ffffffff813f59db>] arp_send+0x3b/0x40
        [<ffffffff813f6424>] arp_solicit+0x204/0x280
        [<ffffffff813a1a70>] ? neigh_add+0x310/0x310
        [<ffffffff8139f515>] neigh_probe+0x45/0x70
        [<ffffffff813a1c10>] neigh_timer_handler+0x1a0/0x2a0
        [<ffffffff8104b3cf>] call_timer_fn+0x7f/0x1c0
        [<ffffffff8104b350>] ? detach_if_pending+0x120/0x120
        [<ffffffff8104b748>] run_timer_softirq+0x238/0x2b0
        [<ffffffff813a1a70>] ? neigh_add+0x310/0x310
        [<ffffffff81043e51>] __do_softirq+0x101/0x280
        [<ffffffff814518cc>] call_softirq+0x1c/0x30
        [<ffffffff81003b65>] do_softirq+0x85/0xc0
        [<ffffffff81043a7e>] irq_exit+0x9e/0xc0
        [<ffffffff810264f8>] smp_apic_timer_interrupt+0x68/0xa0
        [<ffffffff8145122f>] apic_timer_interrupt+0x6f/0x80
        <EOI>  [<ffffffff8100a054>] ? mwait_idle+0xa4/0x1c0
        [<ffffffff8100a04b>] ? mwait_idle+0x9b/0x1c0
        [<ffffffff8100a6a9>] cpu_idle+0x89/0xe0
        [<ffffffff81441127>] start_secondary+0x1b2/0x1b6
      
      Bug is from arp_solicit(), releasing the neigh lock after arp_send()
      In case of vxlan, we eventually need to write lock a neigh lock later.
      
      Its a false positive, but we can get rid of it without lockdep
      annotations.
      
      We can instead use neigh_ha_snapshot() helper.
      Reported-by: default avatarYan Burman <yanb@mellanox.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9650388b
    • Eric Dumazet's avatar
      tuntap: dont use a private kmem_cache · 9fdc6bef
      Eric Dumazet authored
      Commit 96442e42 (tuntap: choose the txq based on rxq)
      added a per tun_struct kmem_cache.
      
      As soon as several tun_struct are used, we get an error
      because two caches cannot have same name.
      
      Use the default kmalloc()/kfree_rcu(), as it reduce code
      size and doesn't have performance impact here.
      Reported-by: default avatarPaul Moore <pmoore@redhat.com>
      Tested-by: default avatarPaul Moore <pmoore@redhat.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarStephen Hemminger <shemminger@vyatta.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9fdc6bef
    • Eric Dumazet's avatar
      net: devnet_rename_seq should be a seqcount · 30e6c9fa
      Eric Dumazet authored
      Using a seqlock for devnet_rename_seq is not a good idea,
      as device_rename() can sleep.
      
      As we hold RTNL, we dont need a protection for writers,
      and only need a seqcount so that readers can catch a change done
      by a writer.
      
      Bug added in commit c91f6df2 (sockopt: Change getsockopt() of
      SO_BINDTODEVICE to return an interface name)
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Brian Haley <brian.haley@hp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      30e6c9fa
    • Eric Dumazet's avatar
      ip_gre: fix possible use after free · f7e75ba1
      Eric Dumazet authored
      Once skb_realloc_headroom() is called, tiph might point to freed memory.
      
      Cache tiph->ttl value before the reallocation, to avoid unexpected
      behavior.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Isaku Yamahata <yamahata@valinux.co.jp>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f7e75ba1
    • Isaku Yamahata's avatar
      ip_gre: make ipgre_tunnel_xmit() not parse network header as IP unconditionally · 412ed947
      Isaku Yamahata authored
      ipgre_tunnel_xmit() parses network header as IP unconditionally.
      But transmitting packets are not always IP packet. For example such packet
      can be sent by packet socket with sockaddr_ll.sll_protocol set.
      So make the function check if skb->protocol is IP.
      Signed-off-by: default avatarIsaku Yamahata <yamahata@valinux.co.jp>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      412ed947
    • Dan Carpenter's avatar
      solos-pci: double lock in geos_gpio_store() · 29042073
      Dan Carpenter authored
      There is a typo here so we do a double lock instead of an unlock.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      29042073
    • Trond Myklebust's avatar
      NFS: Kill fscache warnings when mounting without -ofsc · c4271c6e
      Trond Myklebust authored
      The fscache code will currently bleat a "non-unique superblock keys"
      warning even if the user is mounting without the 'fsc' option.
      
      There should be no reason to even initialise the superblock cache cookie
      unless we're planning on using fscache for something, so ensure that we
      check for the NFS_OPTION_FSCACHE flag before calling into the fscache
      code.
      Reported-by: default avatarPaweł Sikora <pawel.sikora@agmk.net>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: David Howells <dhowells@redhat.com>
      Acked-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c4271c6e
    • David Howells's avatar
      NFS: Provide stub nfs_fscache_wait_on_invalidate() for when CONFIG_NFS_FSCACHE=n · c129c293
      David Howells authored
      Provide a stub nfs_fscache_wait_on_invalidate() function for when
      CONFIG_NFS_FSCACHE=n lest the following error appear:
      
        fs/nfs/inode.c: In function 'nfs_invalidate_mapping':
        fs/nfs/inode.c:887:2: error: implicit declaration of function 'nfs_fscache_wait_on_invalidate' [-Werror=implicit-function-declaration]
        cc1: some warnings being treated as errors
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Reported-by: default avatarVineet Gupta <Vineet.Gupta1@synopsys.com>
      Reported-by: default avatarBorislav Petkov <bp@alien8.de>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c129c293
    • Linus Torvalds's avatar
      Merge tag 'vfio-for-v3.8-v2' of git://github.com/awilliam/linux-vfio · 54e37b8d
      Linus Torvalds authored
      Pull vfio update from Alex Williamson.
      
      * tag 'vfio-for-v3.8-v2' of git://github.com/awilliam/linux-vfio:
        vfio-pci: Enable device before attempting reset
        VFIO: fix out of order labels for error recovery in vfio_pci_init()
        VFIO: use ACCESS_ONCE() to guard access to dev->driver
        VFIO: unregister IOMMU notifier on error recovery path
        vfio-pci: Re-order device reset
        vfio: simplify kmalloc+copy_from_user to memdup_user
      54e37b8d
    • Linus Torvalds's avatar
      Merge branch 'for-next' of git://git.infradead.org/users/eparis/notify · 96680d2b
      Linus Torvalds authored
      Pull filesystem notification updates from Eric Paris:
       "This pull mostly is about locking changes in the fsnotify system.  By
        switching the group lock from a spin_lock() to a mutex() we can now
        hold the lock across things like iput().  This fixes a problem
        involving unmounting a fs and having inodes be busy, first pointed out
        by FAT, but reproducible with tmpfs.
      
        This also restores signal driven I/O for inotify, which has been
        broken since about 2.6.32."
      
      Ugh.  I *hate* the timing of this.  It was rebased after the merge
      window opened, and then left to sit with the pull request coming the day
      before the merge window closes.  That's just crap.  But apparently the
      patches themselves have been around for over a year, just gathering
      dust, so now it's suddenly critical.
      
      Fixed up semantic conflict in fs/notify/fdinfo.c as per Stephen
      Rothwell's fixes from -next.
      
      * 'for-next' of git://git.infradead.org/users/eparis/notify:
        inotify: automatically restart syscalls
        inotify: dont skip removal of watch descriptor if creation of ignored event failed
        fanotify: dont merge permission events
        fsnotify: make fasync generic for both inotify and fanotify
        fsnotify: change locking order
        fsnotify: dont put marks on temporary list when clearing marks by group
        fsnotify: introduce locked versions of fsnotify_add_mark() and fsnotify_remove_mark()
        fsnotify: pass group to fsnotify_destroy_mark()
        fsnotify: use a mutex instead of a spinlock to protect a groups mark list
        fanotify: add an extra flag to mark_remove_from_mask that indicates wheather a mark should be destroyed
        fsnotify: take groups mark_lock before mark lock
        fsnotify: use reference counting for groups
        fsnotify: introduce fsnotify_get_group()
        inotify, fanotify: replace fsnotify_put_group() with fsnotify_destroy_group()
      96680d2b
    • Linus Torvalds's avatar
      Merge branch 'akpm' (Andrew's patch-bomb) · 4c9a44ae
      Linus Torvalds authored
      Merge the rest of Andrew's patches for -rc1:
       "A bunch of fixes and misc missed-out-on things.
      
        That'll do for -rc1.  I still have a batch of IPC patches which still
        have a possible bug report which I'm chasing down."
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (25 commits)
        keys: use keyring_alloc() to create module signing keyring
        keys: fix unreachable code
        sendfile: allows bypassing of notifier events
        SGI-XP: handle non-fatal traps
        fat: fix incorrect function comment
        Documentation: ABI: remove testing/sysfs-devices-node
        proc: fix inconsistent lock state
        linux/kernel.h: fix DIV_ROUND_CLOSEST with unsigned divisors
        memcg: don't register hotcpu notifier from ->css_alloc()
        checkpatch: warn on uapi #includes that #include <uapi/...
        revert "rtc: recycle id when unloading a rtc driver"
        mm: clean up transparent hugepage sysfs error messages
        hfsplus: add error message for the case of failure of sync fs in delayed_sync_fs() method
        hfsplus: rework processing of hfs_btree_write() returned error
        hfsplus: rework processing errors in hfsplus_free_extents()
        hfsplus: avoid crash on failed block map free
        kcmp: include linux/ptrace.h
        drivers/rtc/rtc-imxdi.c: must include <linux/spinlock.h>
        mm: cma: WARN if freed memory is still in use
        exec: do not leave bprm->interp on stack
        ...
      4c9a44ae
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 1f0377ff
      Linus Torvalds authored
      Pull VFS update from Al Viro:
       "fscache fixes, ESTALE patchset, vmtruncate removal series, assorted
        misc stuff."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (79 commits)
        vfs: make lremovexattr retry once on ESTALE error
        vfs: make removexattr retry once on ESTALE
        vfs: make llistxattr retry once on ESTALE error
        vfs: make listxattr retry once on ESTALE error
        vfs: make lgetxattr retry once on ESTALE
        vfs: make getxattr retry once on an ESTALE error
        vfs: allow lsetxattr() to retry once on ESTALE errors
        vfs: allow setxattr to retry once on ESTALE errors
        vfs: allow utimensat() calls to retry once on an ESTALE error
        vfs: fix user_statfs to retry once on ESTALE errors
        vfs: make fchownat retry once on ESTALE errors
        vfs: make fchmodat retry once on ESTALE errors
        vfs: have chroot retry once on ESTALE error
        vfs: have chdir retry lookup and call once on ESTALE error
        vfs: have faccessat retry once on an ESTALE error
        vfs: have do_sys_truncate retry once on an ESTALE error
        vfs: fix renameat to retry on ESTALE errors
        vfs: make do_unlinkat retry once on ESTALE errors
        vfs: make do_rmdir retry once on ESTALE errors
        vfs: add a flags argument to user_path_parent
        ...
      1f0377ff
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal · 54d46ea9
      Linus Torvalds authored
      Pull signal handling cleanups from Al Viro:
       "sigaltstack infrastructure + conversion for x86, alpha and um,
        COMPAT_SYSCALL_DEFINE infrastructure.
      
        Note that there are several conflicts between "unify
        SS_ONSTACK/SS_DISABLE definitions" and UAPI patches in mainline;
        resolution is trivial - just remove definitions of SS_ONSTACK and
        SS_DISABLED from arch/*/uapi/asm/signal.h; they are all identical and
        include/uapi/linux/signal.h contains the unified variant."
      
      Fixed up conflicts as per Al.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
        alpha: switch to generic sigaltstack
        new helpers: __save_altstack/__compat_save_altstack, switch x86 and um to those
        generic compat_sys_sigaltstack()
        introduce generic sys_sigaltstack(), switch x86 and um to it
        new helper: compat_user_stack_pointer()
        new helper: restore_altstack()
        unify SS_ONSTACK/SS_DISABLE definitions
        new helper: current_user_stack_pointer()
        missing user_stack_pointer() instances
        Bury the conditionals from kernel_thread/kernel_execve series
        COMPAT_SYSCALL_DEFINE: infrastructure
      54d46ea9
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm · f59dc2bb
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "A number of smallish fixes scattered around the ARM code.  Probably
        the most serious one is the one from Al addressing the missing locking
        in the swap emulation code."
      
      * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
        ARM: 7607/1: realview: fix private peripheral memory base for EB rev. B boards
        ARM: 7606/1: cache: flush to LoUU instead of LoUIS on uniprocessor CPUs
        ARM: missing ->mmap_sem around find_vma() in swp_emulate.c
        ARM: 7605/1: vmlinux.lds: Move .notes section next to the rodata
        ARM: 7602/1: Pass real "__machine_arch_type" variable to setup_machine_tags() procedure
        ARM: 7600/1: include CONFIG_DEBUG_LL_INCLUDE rather than mach/debug-macro.S
      f59dc2bb
    • Linus Torvalds's avatar
      Merge tag 'fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · f3dc1294
      Linus Torvalds authored
      Pull ARM SoC fixes part 2 from Olof Johansson:
       "Here are a few more fixes for 3.8.  Two branches of fixes for Samsung
        platforms, including fixes for the audio build errors on all non-DT
        platforms.  There's also a fixup to the sunxi device-tree file renames
        due to a bad patch application by me, and a fix for OMAP due to
        function renames merged through the powerpc tree."
      
      * tag 'fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: OMAP2+: Fix compillation error in mach-omap2/timer.c
        ARM: sunxi: rename device tree source files
        ARM: EXYNOS: Avoid passing the clks through platform data
        ARM: S5PV210: Avoid passing the clks through platform data
        ARM: S5P64X0: Add I2S clkdev support
        ARM: S5PC100: Add I2S clkdev support
        ARM: S3C64XX: Add I2S clkdev support
        ARM: EXYNOS: Fix MSHC clocks instance names
        ARM: EXYNOS: Fix NULL pointer dereference bug in SMDKV310
        ARM: EXYNOS: Fix NULL pointer dereference bug in SMDK4X12
        ARM: EXYNOS: Fix NULL pointer dereference bug in Origen
        ARM: SAMSUNG: Add missing include guard to gpio-core.h
        pinctrl: exynos5440/samsung: Staticize pcfgs
        pinctrl: samsung: Fix a typo in pinctrl-samsung.h
        ARM: EXYNOS: fix skip scu_enable() for EXYNOS5440
        ARM: EXYNOS: fix GIC using for EXYNOS5440
        ARM: EXYNOS: fix build error when MFC is not selected
      f3dc1294
    • Linus Torvalds's avatar
      Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild · af487e42
      Linus Torvalds authored
      Pull kbuild misc changes from Michal Marek:
       "This is the non-critical part of kbuild
      
         - scripts/kernel-doc requires a "Return:" section for non-void
           functions
         - ARCH=arm SUBARCH=... support for make tags
         - COMPILED_SOURCE=1 support for make tags (only indexes .c files for
           which a .o exists)
         - New coccinelle check
         - Option parsing fix for scripts/config"
      
      * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
        scripts/config: Fix wrong "shift" for --keep-case
        scripts/tags.sh: Support compiled source
        scripts/tags.sh: Support subarch for ARM
        scripts/coccinelle/misc/warn.cocci: use WARN
        scripts/kernel-doc: check that non-void fcts describe their return value
        Kernel-doc: Convention: Use a "Return" section to describe return values
      af487e42
    • David Howells's avatar
      keys: use keyring_alloc() to create module signing keyring · cfde8190
      David Howells authored
      Use keyring_alloc() to create special keyrings now that it has
      a permissions parameter rather than using key_alloc() +
      key_instantiate_and_link().
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cfde8190
    • Alan Cox's avatar
      keys: fix unreachable code · e67eab39
      Alan Cox authored
      We set ret to NULL then test it. Remove the bogus test
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e67eab39
    • Scott Wolchok's avatar
      sendfile: allows bypassing of notifier events · a68c2f12
      Scott Wolchok authored
      do_sendfile() in fs/read_write.c does not call the fsnotify functions,
      unlike its neighbors.  This manifests as a lack of inotify ACCESS events
      when a file is sent using sendfile(2).
      
      Addresses
        https://bugzilla.kernel.org/show_bug.cgi?id=12812
      
      [akpm@linux-foundation.org: use fsnotify_modify(out.file), not fsnotify_access(), per Dave]
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Scott Wolchok <swolchok@umich.edu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a68c2f12
    • Robin Holt's avatar
      SGI-XP: handle non-fatal traps · 891348ca
      Robin Holt authored
      We found a user code which was raising a divide-by-zero trap.  That trap
      would lead to XPC connections between system-partitions being torn down
      due to the die_chain notifier callouts it received.
      
      This also revealed a different issue where multiple callers into
      xpc_die_deactivate() would all attempt to do the disconnect in parallel
      which would sometimes lock up but often overwhelm the console on very
      large machines as each would print at least one line of output at the
      end of the deactivate.
      
      I reviewed all the users of the die_chain notifier and changed the code
      to ignore the notifier callouts for reasons which will not actually lead
      to a system to continue on to call die().
      
      [akpm@linux-foundation.org: fix ia64]
      Signed-off-by: default avatarRobin Holt <holt@sgi.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      891348ca
    • Ravishankar N's avatar
      fat: fix incorrect function comment · c39540c6
      Ravishankar N authored
      fat_search_long() returns 0 on success, -ENOENT/ENOMEM on failure.
      Change the function comment accordingly.
      
      While at it, fix some trivial typos.
      Signed-off-by: default avatarRavishankar N <cyberax82@gmail.com>
      Signed-off-by: default avatarNamjae Jeon <linkinjeon@gmail.com>
      Acked-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c39540c6
    • Davidlohr Bueso's avatar
      Documentation: ABI: remove testing/sysfs-devices-node · 99bbb2b0
      Davidlohr Bueso authored
      This file is already documented in the stable ABI (see commit
      5bbe1ec1).
      Signed-off-by: default avatarDavidlohr Bueso <davidlohr.bueso@hp.com>
      Cc: Greg KH <greg@kroah.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      99bbb2b0
    • Xiaotian Feng's avatar
      proc: fix inconsistent lock state · ee297209
      Xiaotian Feng authored
      Lockdep found an inconsistent lock state when rcu is processing delayed
      work in softirq.  Currently, kernel is using spin_lock/spin_unlock to
      protect proc_inum_ida, but proc_free_inum is called by rcu in softirq
      context.
      
      Use spin_lock_bh/spin_unlock_bh fix following lockdep warning.
      
        =================================
        [ INFO: inconsistent lock state ]
        3.7.0 #36 Not tainted
        ---------------------------------
        inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
        swapper/1/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
         (proc_inum_lock){+.?...}, at: proc_free_inum+0x1c/0x50
        {SOFTIRQ-ON-W} state was registered at:
           __lock_acquire+0x8ae/0xca0
           lock_acquire+0x199/0x200
           _raw_spin_lock+0x41/0x50
           proc_alloc_inum+0x4c/0xd0
           alloc_mnt_ns+0x49/0xc0
           create_mnt_ns+0x25/0x70
           mnt_init+0x161/0x1c7
           vfs_caches_init+0x107/0x11a
           start_kernel+0x348/0x38c
           x86_64_start_reservations+0x131/0x136
           x86_64_start_kernel+0x103/0x112
        irq event stamp: 2993422
        hardirqs last  enabled at (2993422):  _raw_spin_unlock_irqrestore+0x55/0x80
        hardirqs last disabled at (2993421):  _raw_spin_lock_irqsave+0x29/0x70
        softirqs last  enabled at (2993394):  _local_bh_enable+0x13/0x20
        softirqs last disabled at (2993395):  call_softirq+0x1c/0x30
      
        other info that might help us debug this:
         Possible unsafe locking scenario:
      
               CPU0
               ----
          lock(proc_inum_lock);
          <Interrupt>
            lock(proc_inum_lock);
      
         *** DEADLOCK ***
      
        no locks held by swapper/1/0.
      
        stack backtrace:
        Pid: 0, comm: swapper/1 Not tainted 3.7.0 #36
        Call Trace:
         <IRQ>  [<ffffffff810a40f1>] ? vprintk_emit+0x471/0x510
          print_usage_bug+0x2a5/0x2c0
          mark_lock+0x33b/0x5e0
          __lock_acquire+0x813/0xca0
          lock_acquire+0x199/0x200
          _raw_spin_lock+0x41/0x50
          proc_free_inum+0x1c/0x50
          free_pid_ns+0x1c/0x50
          put_pid_ns+0x2e/0x50
          put_pid+0x4a/0x60
          delayed_put_pid+0x12/0x20
          rcu_process_callbacks+0x462/0x790
          __do_softirq+0x1b4/0x3b0
          call_softirq+0x1c/0x30
          do_softirq+0x59/0xd0
          irq_exit+0x54/0xd0
          smp_apic_timer_interrupt+0x95/0xa3
          apic_timer_interrupt+0x72/0x80
          cpuidle_enter_tk+0x10/0x20
          cpuidle_enter_state+0x17/0x50
          cpuidle_idle_call+0x287/0x520
          cpu_idle+0xba/0x130
          start_secondary+0x2b3/0x2bc
      Signed-off-by: default avatarXiaotian Feng <dannyfeng@tencent.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ee297209
    • Guenter Roeck's avatar
      linux/kernel.h: fix DIV_ROUND_CLOSEST with unsigned divisors · c4e18497
      Guenter Roeck authored
      Commit 263a523d ("linux/kernel.h: Fix warning seen with W=1 due to
      change in DIV_ROUND_CLOSEST") fixes a warning seen with W=1 due to
      change in DIV_ROUND_CLOSEST.
      
      Unfortunately, the C compiler converts divide operations with unsigned
      divisors to unsigned, even if the dividend is signed and negative (for
      example, -10 / 5U = 858993457).  The C standard says "If one operand has
      unsigned int type, the other operand is converted to unsigned int", so
      the compiler is not to blame.  As a result, DIV_ROUND_CLOSEST(0, 2U) and
      similar operations now return bad values, since the automatic conversion
      of expressions such as "0 - 2U/2" to unsigned was not taken into
      account.
      
      Fix by checking for the divisor variable type when deciding which
      operation to perform.  This fixes DIV_ROUND_CLOSEST(0, 2U), but still
      returns bad values for negative dividends divided by unsigned divisors.
      Mark the latter case as unsupported.
      
      One observed effect of this problem is that the s2c_hwmon driver reports
      a value of 4198403 instead of 0 if the ADC reads 0.
      
      Other impact is unpredictable.  Problem is seen if the divisor is an
      unsigned variable or constant and the dividend is less than (divisor/2).
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Reported-by: default avatarJuergen Beisert <jbe@pengutronix.de>
      Tested-by: default avatarJuergen Beisert <jbe@pengutronix.de>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: <stable@vger.kernel.org>	[3.7.x]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c4e18497
    • Tejun Heo's avatar
      memcg: don't register hotcpu notifier from ->css_alloc() · 154b454e
      Tejun Heo authored
      Commit 648bb56d ("cgroup: lock cgroup_mutex in cgroup_init_subsys()")
      made cgroup_init_subsys() grab cgroup_mutex before invoking
      ->css_alloc() for the root css.  Because memcg registers hotcpu notifier
      from ->css_alloc() for the root css, this introduced circular locking
      dependency between cgroup_mutex and cpu hotplug.
      
      Fix it by moving hotcpu notifier registration to a subsys initcall.
      
        ======================================================
        [ INFO: possible circular locking dependency detected ]
        3.7.0-rc4-work+ #42 Not tainted
        -------------------------------------------------------
        bash/645 is trying to acquire lock:
         (cgroup_mutex){+.+.+.}, at: [<ffffffff8110c5b7>] cgroup_lock+0x17/0x20
      
        but task is already holding lock:
         (cpu_hotplug.lock){+.+.+.}, at: [<ffffffff8109300f>] cpu_hotplug_begin+0x2f/0x60
      
        which lock already depends on the new lock.
      
        the existing dependency chain (in reverse order) is:
      
       -> #1 (cpu_hotplug.lock){+.+.+.}:
               lock_acquire+0x97/0x1e0
               mutex_lock_nested+0x61/0x3b0
               get_online_cpus+0x3c/0x60
               rebuild_sched_domains_locked+0x1b/0x70
               cpuset_write_resmask+0x298/0x2c0
               cgroup_file_write+0x1ef/0x300
               vfs_write+0xa8/0x160
               sys_write+0x52/0xa0
               system_call_fastpath+0x16/0x1b
      
       -> #0 (cgroup_mutex){+.+.+.}:
               __lock_acquire+0x14ce/0x1d20
               lock_acquire+0x97/0x1e0
               mutex_lock_nested+0x61/0x3b0
               cgroup_lock+0x17/0x20
               cpuset_handle_hotplug+0x1b/0x560
               cpuset_update_active_cpus+0xe/0x10
               cpuset_cpu_inactive+0x47/0x50
               notifier_call_chain+0x66/0x150
               __raw_notifier_call_chain+0xe/0x10
               __cpu_notify+0x20/0x40
               _cpu_down+0x7e/0x2f0
               cpu_down+0x36/0x50
               store_online+0x5d/0xe0
               dev_attr_store+0x18/0x30
               sysfs_write_file+0xe0/0x150
               vfs_write+0xa8/0x160
               sys_write+0x52/0xa0
               system_call_fastpath+0x16/0x1b
        other info that might help us debug this:
      
         Possible unsafe locking scenario:
      
               CPU0                    CPU1
               ----                    ----
          lock(cpu_hotplug.lock);
                                       lock(cgroup_mutex);
                                       lock(cpu_hotplug.lock);
          lock(cgroup_mutex);
      
         *** DEADLOCK ***
      
        5 locks held by bash/645:
         #0:  (&buffer->mutex){+.+.+.}, at: [<ffffffff8123bab8>] sysfs_write_file+0x48/0x150
         #1:  (s_active#42){.+.+.+}, at: [<ffffffff8123bb38>] sysfs_write_file+0xc8/0x150
         #2:  (x86_cpu_hotplug_driver_mutex){+.+...}, at: [<ffffffff81079277>] cpu_hotplug_driver_lock+0x1
      +7/0x20
         #3:  (cpu_add_remove_lock){+.+.+.}, at: [<ffffffff81093157>] cpu_maps_update_begin+0x17/0x20
         #4:  (cpu_hotplug.lock){+.+.+.}, at: [<ffffffff8109300f>] cpu_hotplug_begin+0x2f/0x60
      
        stack backtrace:
        Pid: 645, comm: bash Not tainted 3.7.0-rc4-work+ #42
        Call Trace:
         print_circular_bug+0x28e/0x29f
         __lock_acquire+0x14ce/0x1d20
         lock_acquire+0x97/0x1e0
         mutex_lock_nested+0x61/0x3b0
         cgroup_lock+0x17/0x20
         cpuset_handle_hotplug+0x1b/0x560
         cpuset_update_active_cpus+0xe/0x10
         cpuset_cpu_inactive+0x47/0x50
         notifier_call_chain+0x66/0x150
         __raw_notifier_call_chain+0xe/0x10
         __cpu_notify+0x20/0x40
         _cpu_down+0x7e/0x2f0
         cpu_down+0x36/0x50
         store_online+0x5d/0xe0
         dev_attr_store+0x18/0x30
         sysfs_write_file+0xe0/0x150
         vfs_write+0xa8/0x160
         sys_write+0x52/0xa0
         system_call_fastpath+0x16/0x1b
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      154b454e
    • Joe Perches's avatar
      checkpatch: warn on uapi #includes that #include <uapi/... · 495e9d84
      Joe Perches authored
      Avoid specifying internal uapi #include paths with uapi/...  as
      userspace should not use and never see that.
      
      Neaten message line wrapping above.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Acked-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarAndy Whitcroft <apw@canonical.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      495e9d84