1. 30 Jan, 2013 3 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus-v3.8-rc6' of git://oss.sgi.com/xfs/xfs · f96736e1
      Linus Torvalds authored
      Pull xfs bugfixes from Ben Myers:
       "Here are fixes for returning EFSCORRUPTED on probe of a non-xfs
        filesystem, the stack switch in xfs_bmapi_allocate, a crash in
        _xfs_buf_find, speculative preallocation as the filesystem nears
        ENOSPC, an unmount hang, a race with AIO, and a regression with
        xfs_fsr:
      
         - fix return value when filesystem probe finds no XFS magic, a
           regression introduced in 98021821.
      
         - fix stack switch in __xfs_bmapi_allocate by moving the check for
           stack switch up into xfs_bmapi_write.
      
         - fix oops in _xfs_buf_find by validating that the requested block is
           within the filesystem bounds.
      
         - limit speculative preallocation near ENOSPC.
      
         - fix an unmount hang in xfs_wait_buftarg by freeing the
           xfs_buf_log_item in xfs_buf_item_unlock.
      
         - fix a possible use after free with AIO.
      
         - fix xfs_swap_extents after removal of xfs_flushinval_pages, a
           regression introduced in commit fb595814."
      
      * tag 'for-linus-v3.8-rc6' of git://oss.sgi.com/xfs/xfs:
        xfs: Fix xfs_swap_extents() after removal of xfs_flushinval_pages()
        xfs: Fix possible use-after-free with AIO
        xfs: fix shutdown hang on invalid inode during create
        xfs: limit speculative prealloc near ENOSPC thresholds
        xfs: fix _xfs_buf_find oops on blocks beyond the filesystem end
        xfs: pull up stack_switch check into xfs_bmapi_write
        xfs: Do not return EFSCORRUPTED when filesystem probe finds no XFS magic
      f96736e1
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 8e5d573a
      Linus Torvalds authored
      Pull one s390 fix from Martin Schwidefsky:
       "Another transparent huge page fix, we need to define a s390 variant
        for pmdp_set_wrprotect to flush the TLB for the huge page correctly."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/thp: implement pmdp_set_wrprotect()
      8e5d573a
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · d6a3bf93
      Linus Torvalds authored
      Pull pinctrl fixes from Linus Walleij:
       "This is a late pinctrl fix pull request, we had to revert out the
        pinctrl-single GPIO backend, because of, well, design issues.  We're
        cooking a better thing for the next cycle.
      
         - Revert gpio request/free backend, new patch set in the works, will
           be for v3.9.  Get this old cruft out before anyone hurts himself on
           it.
         - Kconfig buzz
         - Various compile warnings
         - MPP6 value for the Kirkwood"
      
      * tag 'pinctrl-fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: nomadik: nmk_prcm_gpiocr_get_mode may be unused
        pinctrl: exynos: don't mark probing functions as __init
        Revert "pinctrl: single: support gpio request and free"
        pinctrl: mvebu: fix MPP6 value for kirkwood driver
        pinctrl: mvebu: Fix compiler warnings
        pinctrl: pinctrl-mxs: Fix variables' definition type
        pinctrl: samsung: removing duplicated condition for PINCTRL_SAMSUNG
      d6a3bf93
  2. 29 Jan, 2013 7 commits
  3. 28 Jan, 2013 30 commits
    • Tiejun Chen's avatar
      powerpc: Max next_tb to prevent from replaying timer interrupt · 689dfa89
      Tiejun Chen authored
      With lazy interrupt, we always call __check_irq_replaysome with
      decrementers_next_tb to check if we need to replay timer interrupt.
      So in hotplug case we also need to set decrementers_next_tb as MAX
      to make sure __check_irq_replay don't replay timer interrupt
      when return as we expect, otherwise we'll trap here infinitely.
      Signed-off-by: default avatarTiejun Chen <tiejun.chen@windriver.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      689dfa89
    • Cong Ding's avatar
      powerpc: kernel/kgdb.c: Fix memory leakage · fefd9e6f
      Cong Ding authored
      the variable backup_current_thread_info isn't freed before existing the
      function.
      Signed-off-by: default avatarCong Ding <dinggnu@gmail.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      fefd9e6f
    • Tiejun Chen's avatar
      powerpc/book3e: Disable interrupt after preempt_schedule_irq · 572177d7
      Tiejun Chen authored
      In preempt case current arch_local_irq_restore() from
      preempt_schedule_irq() may enable hard interrupt but we really
      should disable interrupts when we return from the interrupt,
      and so that we don't get interrupted after loading SRR0/1.
      Signed-off-by: default avatarTiejun Chen <tiejun.chen@windriver.com>
      CC: <stable@vger.kernel.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      572177d7
    • Carl E. Love's avatar
      powerpc/oprofile: Fix error in oprofile power7_marked_instr_event() function · 46ed7a76
      Carl E. Love authored
      The calculation for the left shift of the mask OPROFILE_PM_PMCSEL_MSK has an
      error.  The calculation is should be to shift left by (max_cntrs - cntr) times
      the width of the pmsel field width.  However, the #define OPROFILE_MAX_PMC_NUM
      was used instead of OPROFILE_PMSEL_FIELD_WIDTH.  This patch fixes the
      calculation.
      Signed-off-by: default avatarCarl Love <cel@us.ibm.com>
      Acked-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      46ed7a76
    • Steven Rostedt's avatar
      powerpc/pasemi: Fix crash on reboot · 72640d88
      Steven Rostedt authored
      commit f96972f2 "kernel/sys.c: call disable_nonboot_cpus() in
      kernel_restart()"
      
      added a call to disable_nonboot_cpus() on kernel_restart(), which tries
      to shutdown all the CPUs except the first one. The issue with the PA
      Semi, is that it does not support CPU hotplug.
      
      When the call is made to __cpu_down(), it calls the notifiers
      CPU_DOWN_PREPARE, and then tries to take the CPU down.
      
      One of the notifiers to the CPU hotplug code, is the cpufreq. The
      DOWN_PREPARE will call __cpufreq_remove_dev() which calls
      cpufreq_driver->exit. The PA Semi exit handler unmaps regions of I/O
      that is used by an interrupt that goes off constantly
      (system_reset_common, but it goes off during normal system operations
      too). I'm not sure exactly what this interrupt does.
      
      Running a simple function trace, you can see it goes off quite a bit:
      
      # tracer: function
      #
      #           TASK-PID    CPU#    TIMESTAMP  FUNCTION
      #              | |       |          |         |
                <idle>-0     [001]  1558.859363: .pasemi_system_reset_exception <-.system_reset_exception
                <idle>-0     [000]  1558.860112: .pasemi_system_reset_exception <-.system_reset_exception
                <idle>-0     [000]  1558.861109: .pasemi_system_reset_exception <-.system_reset_exception
                <idle>-0     [001]  1558.861361: .pasemi_system_reset_exception <-.system_reset_exception
                <idle>-0     [000]  1558.861437: .pasemi_system_reset_exception <-.system_reset_exception
      
      When the region is unmapped, the system crashes with:
      
      Disabling non-boot CPUs ...
      Error taking CPU1 down: -38
      Unable to handle kernel paging request for data at address 0xd0000800903a0100
      Faulting instruction address: 0xc000000000055fcc
      Oops: Kernel access of bad area, sig: 11 [#1]
      PREEMPT SMP NR_CPUS=64 NUMA PA Semi PWRficient
      Modules linked in: shpchp
      NIP: c000000000055fcc LR: c000000000055fb4 CTR: c0000000000df1fc
      REGS: c0000000012175d0 TRAP: 0300   Not tainted  (3.8.0-rc4-test-dirty)
      MSR: 9000000000009032 <SF,HV,EE,ME,IR,DR,RI>  CR: 24000088  XER: 00000000
      SOFTE: 0
      DAR: d0000800903a0100, DSISR: 42000000
      TASK = c0000000010e9008[0] 'swapper/0' THREAD: c000000001214000 CPU: 0
      GPR00: d0000800903a0000 c000000001217850 c0000000012167e0 0000000000000000
      GPR04: 0000000000000000 0000000000000724 0000000000000724 0000000000000000
      GPR08: 0000000000000000 0000000000000000 0000000000000001 0000000000a70000
      GPR12: 0000000024000080 c00000000fff0000 ffffffffffffffff 000000003ffffae0
      GPR16: ffffffffffffffff 0000000000a21198 0000000000000060 0000000000000000
      GPR20: 00000000008fdd35 0000000000a21258 000000003ffffaf0 0000000000000417
      GPR24: 0000000000a226d0 c000000000000000 0000000000000000 0000000000000000
      GPR28: c00000000138b358 0000000000000000 c000000001144818 d0000800903a0100
      NIP [c000000000055fcc] .set_astate+0x5c/0xa4
      LR [c000000000055fb4] .set_astate+0x44/0xa4
      Call Trace:
      [c000000001217850] [c000000000055fb4] .set_astate+0x44/0xa4 (unreliable)
      [c0000000012178f0] [c00000000005647c] .restore_astate+0x2c/0x34
      [c000000001217980] [c000000000054668] .pasemi_system_reset_exception+0x6c/0x88
      [c000000001217a00] [c000000000019ef0] .system_reset_exception+0x48/0x84
      [c000000001217a80] [c000000000001e40] system_reset_common+0x140/0x180
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      72640d88
    • Linus Torvalds's avatar
      Merge tag 'md-3.8-fixes' of git://neil.brown.name/md · f94d4fe0
      Linus Torvalds authored
      Pull dmraid fix from NeilBrown:
       "Just one fix for md in 3.8
      
        dmraid assess redundancy and replacements slightly inaccurately which
        could lead to some degraded arrays failing to assemble."
      
      * tag 'md-3.8-fixes' of git://neil.brown.name/md:
        DM-RAID: Fix RAID10's check for sufficient redundancy
      f94d4fe0
    • Li Zhong's avatar
      powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning for ppc32 · 41d82bdb
      Li Zhong authored
      This patch fixes MAX_STACK_TRACE_ENTRIES too low warning for ppc32,
      which is similar to commit 12660b17.
      Reported-by: default avatarChristian Kujau <lists@nerdbynature.de>
      Signed-off-by: default avatarLi Zhong <zhong@linux.vnet.ibm.com>
      Tested-by: default avatarChristian Kujau <lists@nerdbynature.de>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      41d82bdb
    • Torsten Kaiser's avatar
      xfs: Fix xfs_swap_extents() after removal of xfs_flushinval_pages() · 65e3aa77
      Torsten Kaiser authored
      Commit fb595814 removed
      xfs_flushinval_pages() and changed its callers to use
      filemap_write_and_wait() and  truncate_pagecache_range() directly.
      
      But in xfs_swap_extents() this change accidental switched the argument
      for 'tip' to 'ip'. This patch switches it back to 'tip'
      Signed-off-by: default avatarTorsten Kaiser <just.for.lkml@googlemail.com>
      Reviewed-by: default avatarBen Myers <bpm@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      65e3aa77
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes · 45e72af0
      Linus Torvalds authored
      Pull GFS2 fix from Steven Whitehouse.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes:
        GFS2: fix skip unlock condition
      45e72af0
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v3.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · ae2c3d95
      Linus Torvalds authored
      Pull IOMMU fix from Joerg Roedel:
       "One fix for the AMD IOMMU driver to work around broken BIOSes found in
        the field.  Some BIOSes forget to enable a workaround for a hardware
        problem which might cause the IOMMU to stop working under high load
        conditions.  The fix makes sure this workaround is enabled."
      
      * tag 'iommu-fixes-v3.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        IOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround
      ae2c3d95
    • Linus Torvalds's avatar
      Merge tag 'mfd-for-linus-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 · 325a86b6
      Linus Torvalds authored
      Pull MFD fixes from Samuel Ortiz:
       "This is the first pull request for MFD fixes for 3.8
      
        We have some build failure fixes (twl4030, vexpress, abx500 and
        tps65910), some actual runtime oops and lockup fixes (rtsx, da9052),
        and some more hypothetical NULL pointers dereferences fixes for
        pcf50633 and max776xx.
      
        Then we also have additional rtsx fixes for a correct switch output
        voltage and clock divider correctness for rtl8411 (rtsx driver), and
        irqdomain fix for db8550-prcmu, and some more cosmetic fixes for
        arizona and wm5102."
      
      * tag 'mfd-for-linus-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
        mfd: rtsx: Fix oops when rtsx_pci_sdmmc is not probed
        mfd: wm5102: Fix definition of WM5102_MAX_REGISTER
        mfd: twl4030: Don't warn about uninitialized return code
        mfd: da9052/53 lockup fix
        mfd: rtsx: Add clock divider hook
        mmc: rtsx: Call MFD hook to switch output voltage
        mfd: rtsx: Add output voltage switch hook
        mfd: Fix compile errors and warnings when !CONFIG_AB8500_BM
        mfd: vexpress: Export global functions to fix build error
        mfd: arizona: Check errors from regcache_sync()
        mfd: tc3589x: Use simple irqdomain
        mfd: pcf50633: Init pcf->dev before using it
        mfd: max77693: Init max77693->dev before using it
        mfd: max77686: Init max77686->dev before using it
        mfd: db8500-prcmu: Fix irqdomain usage
        mfd: tps65910: Select REGMAP_IRQ in Kconfig to fix build error
        mfd: arizona: Disable control interface reporting for WM5102 and WM5110
      325a86b6
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 22f83798
      Linus Torvalds authored
      Pull networking updates from David Miller:
       "Much more accumulated than I would have liked due to an unexpected
        bout with a nasty flu:
      
         1) AH and ESP input don't set ECN field correctly because the
            transport head of the SKB isn't set correctly, fix from Li
            RongQing.
      
         2) If netfilter conntrack zones are disabled, we can return an
            uninitialized variable instead of the proper error code.  Fix from
            Borislav Petkov.
      
         3) Fix double SKB free in ath9k driver beacon handling, from Felix
            Feitkau.
      
         4) Remove bogus assumption about netns cleanup ordering in
            nf_conntrack, from Pablo Neira Ayuso.
      
         5) Remove a bogus BUG_ON in the new TCP fastopen code, from Eric
            Dumazet.  It uses spin_is_locked() in it's test and is therefore
            unsuitable for UP.
      
         6) Fix SELINUX labelling regressions added by the tuntap multiqueue
            changes, from Paul Moore.
      
         7) Fix CRC errors with jumbo frame receive in tg3 driver, from Nithin
            Nayak Sujir.
      
         8) CXGB4 driver sets interrupt coalescing parameters only on first
            queue, rather than all of them.  Fix from Thadeu Lima de Souza
            Cascardo.
      
         9) Fix regression in the dispatch of read/write registers in dm9601
            driver, from Tushar Behera.
      
        10) ipv6_append_data miscalculates header length, from Romain KUNTZ.
      
        11) Fix PMTU handling regressions on ipv4 routes, from Steffen
            Klassert, Timo Teräs, and Julian Anastasov.
      
        12) In 3c574_cs driver, add necessary parenthesis to "x << y & z"
            expression.  From Nickolai Zeldovich.
      
        13) macvlan_get_size() causes underallocation netlink message space,
            fix from Eric Dumazet.
      
        14) Avoid division by zero in xfrm_replay_advance_bmp(), from Nickolai
            Zeldovich.  Amusingly the zero check was already there, we were
            just performing it after the modulus :-)
      
        15) Some more splice bug fixes from Eric Dumazet, which fix things
            mostly eminating from how we now more aggressively use high-order
            pages in SKBs.
      
        16) Fix size calculation bug when freeing hash tables in the IPSEC
            xfrm code, from Michal Kubecek.
      
        17) Fix PMTU event propagation into socket cached routes, from Steffen
            Klassert.
      
        18) Fix off by one in TX buffer release in netxen driver, from Eric
            Dumazet.
      
        19) Fix rediculous memory allocation requirements introduced by the
            tuntap multiqueue changes, from Jason Wang.
      
        20) Remove bogus AMD platform workaround in r8169 driver that causes
            major problems in normal operation, from Timo Teräs.
      
        21) virtio-net set affinity and select queue don't handle
            discontiguous cpu numbers properly, fix from Wanlong Gao.
      
        22) Fix a route refcounting issue in loopback driver, from Eric
            Dumazet.  There's a similar fix coming that we might add to the
            macvlan driver as well.
      
        23) Fix SKB leaks in batman-adv's distributed arp table code, from
            Matthias Schiffer.
      
        24) r8169 driver gives descriptor ownership back the hardware before
            we're done reading the VLAN tag out of it, fix from Francois
            Romieu.
      
        25) Checksums not calculated properly in GRE tunnel driver fix from
            Pravin B Shelar.
      
      26) Fix SCTP memory leak on namespace exit."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (101 commits)
        dm9601: support dm9620 variant
        SCTP: Free the per-net sysctl table on net exit. v2
        net: phy: icplus: fix broken INTR pin settings
        net: phy: icplus: Use the RGMII interface mode to configure clock delays
        IP_GRE: Fix kernel panic in IP_GRE with GRE csum.
        sctp: set association state to established in dupcook_a handler
        ip6mr: limit IPv6 MRT_TABLE identifiers
        r8169: fix vlan tag read ordering.
        net: cdc_ncm: use IAD provided by the USB core
        batman-adv: filter ARP packets with invalid MAC addresses in DAT
        batman-adv: check for more types of invalid IP addresses in DAT
        batman-adv: fix skb leak in batadv_dat_snoop_incoming_arp_reply()
        net: loopback: fix a dst refcounting issue
        virtio-net: reset virtqueue affinity when doing cpu hotplug
        virtio-net: split out clean affinity function
        virtio-net: fix the set affinity bug when CPU IDs are not consecutive
        can: pch_can: fix invalid error codes
        can: ti_hecc: fix invalid error codes
        can: c_can: fix invalid error codes
        r8169: remove the obsolete and incorrect AMD workaround
        ...
      22f83798
    • Jan Kara's avatar
      xfs: Fix possible use-after-free with AIO · 4b05d09c
      Jan Kara authored
      Running AIO is pinning inode in memory using file reference. Once AIO
      is completed using aio_complete(), file reference is put and inode can
      be freed from memory. So we have to be sure that calling aio_complete()
      is the last thing we do with the inode.
      
      CC: xfs@oss.sgi.com
      CC: Ben Myers <bpm@sgi.com>
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Reviewed-by: default avatarBen Myers <bpm@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      4b05d09c
    • Dave Chinner's avatar
      xfs: fix shutdown hang on invalid inode during create · 9f87832a
      Dave Chinner authored
      When the new inode verify in xfs_iread() fails, the create
      transaction is aborted and a shutdown occurs. The subsequent unmount
      then hangs in xfs_wait_buftarg() on a buffer that has an elevated
      hold count. Debug showed that it was an AGI buffer getting stuck:
      
      [   22.576147] XFS (vdb): buffer 0x2/0x1, hold 0x2 stuck
      [   22.976213] XFS (vdb): buffer 0x2/0x1, hold 0x2 stuck
      [   23.376206] XFS (vdb): buffer 0x2/0x1, hold 0x2 stuck
      [   23.776325] XFS (vdb): buffer 0x2/0x1, hold 0x2 stuck
      
      The trace of this buffer leading up to the shutdown (trimmed for
      brevity) looks like:
      
      xfs_buf_init:        bno 0x2 nblks 0x1 hold 1 caller xfs_buf_get_map
      xfs_buf_get:         bno 0x2 len 0x200 hold 1 caller xfs_buf_read_map
      xfs_buf_read:        bno 0x2 len 0x200 hold 1 caller xfs_trans_read_buf_map
      xfs_buf_iorequest:   bno 0x2 nblks 0x1 hold 1 caller _xfs_buf_read
      xfs_buf_hold:        bno 0x2 nblks 0x1 hold 1 caller xfs_buf_iorequest
      xfs_buf_rele:        bno 0x2 nblks 0x1 hold 2 caller xfs_buf_iorequest
      xfs_buf_iowait:      bno 0x2 nblks 0x1 hold 1 caller _xfs_buf_read
      xfs_buf_ioerror:     bno 0x2 len 0x200 hold 1 caller xfs_buf_bio_end_io
      xfs_buf_iodone:      bno 0x2 nblks 0x1 hold 1 caller _xfs_buf_ioend
      xfs_buf_iowait_done: bno 0x2 nblks 0x1 hold 1 caller _xfs_buf_read
      xfs_buf_hold:        bno 0x2 nblks 0x1 hold 1 caller xfs_buf_item_init
      xfs_trans_read_buf:  bno 0x2 len 0x200 hold 2 recur 0 refcount 1
      xfs_trans_brelse:    bno 0x2 len 0x200 hold 2 recur 0 refcount 1
      xfs_buf_item_relse:  bno 0x2 nblks 0x1 hold 2 caller xfs_trans_brelse
      xfs_buf_rele:        bno 0x2 nblks 0x1 hold 2 caller xfs_buf_item_relse
      xfs_buf_unlock:      bno 0x2 nblks 0x1 hold 1 caller xfs_trans_brelse
      xfs_buf_rele:        bno 0x2 nblks 0x1 hold 1 caller xfs_trans_brelse
      xfs_buf_trylock:     bno 0x2 nblks 0x1 hold 2 caller _xfs_buf_find
      xfs_buf_find:        bno 0x2 len 0x200 hold 2 caller xfs_buf_get_map
      xfs_buf_get:         bno 0x2 len 0x200 hold 2 caller xfs_buf_read_map
      xfs_buf_read:        bno 0x2 len 0x200 hold 2 caller xfs_trans_read_buf_map
      xfs_buf_hold:        bno 0x2 nblks 0x1 hold 2 caller xfs_buf_item_init
      xfs_trans_read_buf:  bno 0x2 len 0x200 hold 3 recur 0 refcount 1
      xfs_trans_log_buf:   bno 0x2 len 0x200 hold 3 recur 0 refcount 1
      xfs_buf_item_unlock: bno 0x2 len 0x200 hold 3 flags DIRTY liflags ABORTED
      xfs_buf_unlock:      bno 0x2 nblks 0x1 hold 3 caller xfs_buf_item_unlock
      xfs_buf_rele:        bno 0x2 nblks 0x1 hold 3 caller xfs_buf_item_unlock
      
      And that is the AGI buffer from cold cache read into memory to
      transaction abort. You can see at transaction abort the bli is dirty
      and only has a single reference. The item is not pinned, and it's
      not in the AIL. Hence the only reference to it is this transaction.
      
      The problem is that the xfs_buf_item_unlock() call is dropping the
      last reference to the xfs_buf_log_item attached to the buffer (which
      holds a reference to the buffer), but it is not freeing the
      xfs_buf_log_item. Hence nothing will ever release the buffer, and
      the unmount hangs waiting for this reference to go away.
      
      The fix is simple - xfs_buf_item_unlock needs to detect the last
      reference going away in this case and free the xfs_buf_log_item to
      release the reference it holds on the buffer.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBen Myers <bpm@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      9f87832a
    • Dave Chinner's avatar
      xfs: limit speculative prealloc near ENOSPC thresholds · f2a45956
      Dave Chinner authored
      There is a window on small filesytsems where specualtive
      preallocation can be larger than that ENOSPC throttling thresholds,
      resulting in specualtive preallocation trying to reserve more space
      than there is space available. This causes immediate ENOSPC to be
      triggered, prealloc to be turned off and flushing to occur. One the
      next write (i.e. next 4k page), we do exactly the same thing, and so
      effective drive into synchronous 4k writes by triggering ENOSPC
      flushing on every page while in the window between the prealloc size
      and the ENOSPC prealloc throttle threshold.
      
      Fix this by checking to see if the prealloc size would consume all
      free space, and throttle it appropriately to avoid premature
      ENOSPC...
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      f2a45956
    • Dave Chinner's avatar
      xfs: fix _xfs_buf_find oops on blocks beyond the filesystem end · eb178619
      Dave Chinner authored
      When _xfs_buf_find is passed an out of range address, it will fail
      to find a relevant struct xfs_perag and oops with a null
      dereference. This can happen when trying to walk a filesystem with a
      metadata inode that has a partially corrupted extent map (i.e. the
      block number returned is corrupt, but is otherwise intact) and we
      try to read from the corrupted block address.
      
      In this case, just fail the lookup. If it is readahead being issued,
      it will simply not be done, but if it is real read that fails we
      will get an error being reported.  Ideally this case should result
      in an EFSCORRUPTED error being reported, but we cannot return an
      error through xfs_buf_read() or xfs_buf_get() so this lookup failure
      may result in ENOMEM or EIO errors being reported instead.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarBen Myers <bpm@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      eb178619
    • Brian Foster's avatar
      xfs: pull up stack_switch check into xfs_bmapi_write · d26978dd
      Brian Foster authored
      The stack_switch check currently occurs in __xfs_bmapi_allocate,
      which means the stack switch only occurs when xfs_bmapi_allocate()
      is called in a loop. Pull the check up before the loop in
      xfs_bmapi_write() such that the first iteration of the loop has
      consistent behavior.
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      d26978dd
    • Eric Sandeen's avatar
      xfs: Do not return EFSCORRUPTED when filesystem probe finds no XFS magic · 1bee12b8
      Eric Sandeen authored
      98021821 changed the return value from EWRONGFS (aka EINVAL)
      to EFSCORRUPTED which doesn't seem to be handled properly by
      the root filesystem probe.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Tested-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      Reviewed-by: default avatarBen Myers <bpm@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      1bee12b8
    • Suravee Suthikulpanit's avatar
      IOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround · 318fe782
      Suravee Suthikulpanit authored
      The IOMMU may stop processing page translations due to a perceived lack
      of credits for writing upstream peripheral page service request (PPR)
      or event logs. If the L2B miscellaneous clock gating feature is enabled
      the IOMMU does not properly register credits after the log request has
      completed, leading to a potential system hang.
      
      BIOSes are supposed to disable L2B micellaneous clock gating by setting
      L2_L2B_CK_GATE_CONTROL[CKGateL2BMiscDisable](D0F2xF4_x90[2]) = 1b. This
      patch corrects that for those which do not enable this workaround.
      Signed-off-by: default avatarSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJoerg Roedel <joro@8bytes.org>
      318fe782
    • David Teigland's avatar
      GFS2: fix skip unlock condition · d4e0bfec
      David Teigland authored
      The recent commit fb6791d1
      included the wrong logic.  The lvbptr check was incorrectly
      added after the patch was tested.
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      d4e0bfec
    • Peter Korsgaard's avatar
      dm9601: support dm9620 variant · 6642f91c
      Peter Korsgaard authored
      dm9620 is a newer variant of dm9601 with more features (usb 2.0, checksum
      offload, ..), but it can also be put in a dm9601 compatible mode, allowing
      us to reuse the existing driver.
      
      This does mean that the extended features like checksum offload cannot be
      used, but that's hardly critical on a 100mbps interface.
      
      Thanks to Sławek Wernikowski <slawek@wernikowski.net> for providing me
      with a dm9620 based device to test.
      Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6642f91c
    • Vlad Yasevich's avatar
      SCTP: Free the per-net sysctl table on net exit. v2 · 5f19d121
      Vlad Yasevich authored
      Per-net sysctl table needs to be explicitly freed at
      net exit.  Otherwise we see the following with kmemleak:
      
      unreferenced object 0xffff880402d08000 (size 2048):
        comm "chrome_sandbox", pid 18437, jiffies 4310887172 (age 9097.630s)
        hex dump (first 32 bytes):
          b2 68 89 81 ff ff ff ff 20 04 04 f8 01 88 ff ff  .h...... .......
          04 00 00 00 a4 01 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<ffffffff815b4aad>] kmemleak_alloc+0x21/0x3e
          [<ffffffff81110352>] slab_post_alloc_hook+0x28/0x2a
          [<ffffffff81113fad>] __kmalloc_track_caller+0xf1/0x104
          [<ffffffff810f10c2>] kmemdup+0x1b/0x30
          [<ffffffff81571e9f>] sctp_sysctl_net_register+0x1f/0x72
          [<ffffffff8155d305>] sctp_net_init+0x100/0x39f
          [<ffffffff814ad53c>] ops_init+0xc6/0xf5
          [<ffffffff814ad5b7>] setup_net+0x4c/0xd0
          [<ffffffff814ada5e>] copy_net_ns+0x6d/0xd6
          [<ffffffff810938b1>] create_new_namespaces+0xd7/0x147
          [<ffffffff810939f4>] copy_namespaces+0x63/0x99
          [<ffffffff81076733>] copy_process+0xa65/0x1233
          [<ffffffff81077030>] do_fork+0x10b/0x271
          [<ffffffff8100a0e9>] sys_clone+0x23/0x25
          [<ffffffff815dda73>] stub_clone+0x13/0x20
          [<ffffffffffffffff>] 0xffffffffffffffff
      
      I fixed the spelling of sysctl_header so the code actually
      compiles. -- EWB.
      Reported-by: default avatarMartin Mokrejs <mmokrejs@fold.natur.cuni.cz>
      Signed-off-by: default avatarVlad Yasevich <vyasevich@gmail.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5f19d121
    • Giuseppe CAVALLARO's avatar
      net: phy: icplus: fix broken INTR pin settings · 014f2ffd
      Giuseppe CAVALLARO authored
      This patch fixes the setting of the INTR pin that is
      valid for IP101 A/G device and not for the IP1001.
      Reported-by: default avatarAnunay Saxena <anunay.saxena@st.com>
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      014f2ffd
    • Stuart Menefy's avatar
      net: phy: icplus: Use the RGMII interface mode to configure clock delays · b4a49631
      Stuart Menefy authored
      Like several other PHY devices which support RGMII, the IC+1001 allows
      additional delays to by added to the RX_CLK and TX_CLK signals to
      compensate for skew between the clock and data signals. Previously this
      was always enabled, but this change makes use of the different RGMII
      interface modes to allow the user to specify whether this should be
      enabled.
      Signed-off-by: default avatarStuart Menefy <stuart.menefy@st.com>
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4a49631
    • Pravin B Shelar's avatar
      IP_GRE: Fix kernel panic in IP_GRE with GRE csum. · 5465740a
      Pravin B Shelar authored
      Due to IP_GRE GSO support, GRE can recieve non linear skb which
      results in panic in case of GRE_CSUM.  Following patch fixes it by
      using correct csum API.
      
      Bug introduced in commit 6b78f16e (gre: add GSO support)
      Signed-off-by: default avatarPravin B Shelar <pshelar@nicira.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5465740a
    • Xufeng Zhang's avatar
      sctp: set association state to established in dupcook_a handler · 9839ff0d
      Xufeng Zhang authored
      While sctp handling a duplicate COOKIE-ECHO and the action is
      'Association restart', sctp_sf_do_dupcook_a() will processing
      the unexpected COOKIE-ECHO for peer restart, but it does not set
      the association state to SCTP_STATE_ESTABLISHED, so the association
      could stuck in SCTP_STATE_SHUTDOWN_PENDING state forever.
      This violates the sctp specification:
        RFC 4960 5.2.4. Handle a COOKIE ECHO when a TCB Exists
        Action
        A) In this case, the peer may have restarted. .....
           After this, the endpoint shall enter the ESTABLISHED state.
      
      To resolve this problem, adding a SCTP_CMD_NEW_STATE cmd to the
      command list before SCTP_CMD_REPLY cmd, this will set the restart
      association to SCTP_STATE_ESTABLISHED state properly and also avoid
      I-bit being set in the DATA chunk header when COOKIE_ACK is bundled
      with DATA chunks.
      Signed-off-by: default avatarXufeng Zhang <xufeng.zhang@windriver.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9839ff0d
    • Dan Carpenter's avatar
      ip6mr: limit IPv6 MRT_TABLE identifiers · 75356a81
      Dan Carpenter authored
      We did this for IPv4 in b49d3c1e "net: ipmr: limit MRT_TABLE
      identifiers" but we need to do it for IPv6 as well.  On IPv6 the name
      is "pim6reg" instead of "pimreg" so there is one less digit allowed.
      
      The strcpy() is in ip6mr_reg_vif().
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      75356a81
    • françois romieu's avatar
      r8169: fix vlan tag read ordering. · ce11ff5e
      françois romieu authored
      Control of receive descriptor must not be returned to ethernet chipset
      before vlan tag processing is done.
      
      VLAN tag receive word is now reset both in normal and error path.
      Signed-off-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
      Spotted-by: default avatarTimo Teras <timo.teras@iki.fi>
      Cc: Hayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ce11ff5e
    • Bjørn Mork's avatar
      net: cdc_ncm: use IAD provided by the USB core · 56a666dc
      Bjørn Mork authored
      commit 9992c2e2 (net: cdc_ncm: workaround for missing CDC Union)
      added code to lookup an IAD for the interface we are probing.
      This is redundant.  The USB core has already done the lookup
      and saved the result in the USB interface struct.  Use that
      instead.
      
      Cc: Greg Suarez <gsuarez@smithmicro.com>
      Cc: Alexey Orishko <alexey.orishko@stericsson.com>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      56a666dc
    • David S. Miller's avatar
      Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge · 2afd0a24
      David S. Miller authored
      Included changes ares:
      - fix an skb memleak in DAT
      - fix the ARP filtering routine in DAT by preventing bogus entries to overwrite
        already existing ones in the local cache.
      - fix the ARP filtering routine in DAT by preventing it to parse and add to the
        cache bogus entries
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2afd0a24