1. 04 10月, 2016 8 次提交
  2. 03 10月, 2016 24 次提交
    • A
      net: mvmdio: do not clk_disable_unprepare() NULL clock · f814bfd7
      Alexey Khoroshilov 提交于
      There is no need to clk_disable_unprepare(dev->clk)
      before it was initialized.
      
      Found by Linux Driver Verification project (linuxtesting.org).
      Signed-off-by: NAlexey Khoroshilov <khoroshilov@ispras.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f814bfd7
    • D
      Merge tag 'rxrpc-rewrite-20160930' of... · 7667d445
      David S. Miller 提交于
      Merge tag 'rxrpc-rewrite-20160930' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
      
      David Howells says:
      
      ====================
      rxrpc: More fixes and adjustments
      
      This set of patches contains some more fixes and adjustments:
      
       (1) Actually display the retransmission indication previously added to the
           tx_data trace.
      
       (2) Switch to Congestion Avoidance mode properly at cwnd==ssthresh rather
           than relying on detection during an overshoot and correction.
      
       (3) Reduce ssthresh to the peer's declared receive window.
      
       (4) The offset field in rxrpc_skb_priv can be dispensed with and the error
           field is no longer used.  Get rid of them.
      
       (5) Keep the call timeouts as ktimes rather than jiffies to make it easier
           to deal with RTT-based timeout values in future.  Rounding to jiffies
           is still necessary when the system timer is set.
      
       (6) Fix the call timer handling to avoid retriggering of expired timeout
           actions.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7667d445
    • D
      Merge branch 'ovs-mpls' · 32986b55
      David S. Miller 提交于
      Jiri Benc says:
      
      ====================
      openvswitch: mpls fix and clean up
      
      Convert to the new mpls skb layout the last remaining place in openvswitch,
      forgotten on the mpls GSO rework. The GSO rework also allows for some
      cleanup in the third patch.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      32986b55
    • J
      openvswitch: use mpls_hdr · 85de4a21
      Jiri Benc 提交于
      skb_mpls_header is equivalent to mpls_hdr now. Use the existing helper
      instead.
      Signed-off-by: NJiri Benc <jbenc@redhat.com>
      Acked-by: NPravin B Shelar <pshelar@ovn.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      85de4a21
    • J
      mpls: move mpls_hdr to a common location · 9095e10e
      Jiri Benc 提交于
      This will be also used by openvswitch.
      Signed-off-by: NJiri Benc <jbenc@redhat.com>
      Acked-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Acked-by: NPravin B Shelar <pshelar@ovn.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9095e10e
    • J
      openvswitch: mpls: set network header correctly on key extract · f7d49bce
      Jiri Benc 提交于
      After the 48d2ab60 ("net: mpls: Fixups for GSO"), MPLS handling in
      openvswitch was changed to have network header pointing to the start of the
      MPLS headers and inner_network_header pointing after the MPLS headers.
      
      However, key_extract was missed by the mentioned commit, causing incorrect
      headers to be set when a MPLS packet just enters the bridge or after it is
      recirculated.
      
      Fixes: 48d2ab60 ("net: mpls: Fixups for GSO")
      Signed-off-by: NJiri Benc <jbenc@redhat.com>
      Acked-by: NPravin B Shelar <pshelar@ovn.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f7d49bce
    • A
      mlxsw: spectrum_router: avoid potential uninitialized data usage · ab580705
      Arnd Bergmann 提交于
      If fi->fib_nhs is zero, the router interface pointer is uninitialized, as shown by
      this warning:
      
      drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c: In function 'mlxsw_sp_router_fib_event':
      drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:1674:21: error: 'r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:1643:23: note: 'r' was declared here
      
      This changes the loop so we handle the case the same way as finding no router
      interface pointer attached to one of the nexthops to ensure we always
      trap here instead of using uninitialized data.
      
      Fixes: b45f64d1 ("mlxsw: spectrum_router: Use FIB notifications instead of switchdev calls")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ab580705
    • A
      net/mlx5e: shut up maybe-uninitialized warning · d0debb76
      Arnd Bergmann 提交于
      Build-testing this driver with -Wmaybe-uninitialized gives a new false-positive
      warning that I can't really explain:
      
      drivers/net/ethernet/mellanox/mlx5/core/en_tc.c: In function 'mlx5e_configure_flower':
      drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:509:3: error: 'old_attr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      It's obvious from the code that 'old_attr' is initialized whenever 'old'
      is non-NULL here. The warning appears with all versions I tested from gcc-4.7
      through gcc-6.1, and I could not come up with a way to rewrite the function
      in a more readable way that avoids the warning, so I'm adding another
      initialization to shut it up.
      
      Fixes: 8b32580d ("net/mlx5e: Add TC vlan action for SRIOV offloads")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0debb76
    • A
      cxgb4: unexport cxgb4_dcb_enabled · 7c70c4f8
      Arnd Bergmann 提交于
      A recent cleanup marked cxgb4_dcb_enabled as 'static', which is correct, but this ignored
      how the symbol is also exported. In addition, the export can be compiled out when modules
      are disabled, causing a harmless compiler warning in configurations for which it is not
      used at all:
      
      drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:282:12: error: 'cxgb4_dcb_enabled' defined but not used [-Werror=unused-function]
      
      This removes the export and moves the function into the correct #ifdef so we only build
      it when there are users.
      
      Fixes: 50935857 ("cxgb4: mark symbols static where possible")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c70c4f8
    • A
      net: rtnl: avoid uninitialized data in IFLA_VF_VLAN_LIST handling · fa34cd94
      Arnd Bergmann 提交于
      With the newly added support for IFLA_VF_VLAN_LIST netlink messages,
      we get a warning about potential uninitialized variable use in
      the parsing of the user input when enabling the -Wmaybe-uninitialized
      warning:
      
      net/core/rtnetlink.c: In function 'do_setvfinfo':
      net/core/rtnetlink.c:1756:9: error: 'ivvl$' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      I have not been able to prove whether it is possible to arrive in
      this code with an empty IFLA_VF_VLAN_LIST block, but if we do,
      then ndo_set_vf_vlan gets called with uninitialized arguments.
      
      This adds an explicit check for an empty list, making it obvious
      to the reader and the compiler that this cannot happen.
      
      Fixes: 79aab093 ("net: Update API for VF vlan protocol 802.1ad support")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fa34cd94
    • P
      net: pktgen: fix pkt_size · 63d75463
      Paolo Abeni 提交于
      The commit 879c7220 ("net: pktgen: Observe needed_headroom
      of the device") increased the 'pkt_overhead' field value by
      LL_RESERVED_SPACE.
      As a side effect the generated packet size, computed as:
      
      	/* Eth + IPh + UDPh + mpls */
      	datalen = pkt_dev->cur_pkt_size - 14 - 20 - 8 -
      		  pkt_dev->pkt_overhead;
      
      is decreased by the same value.
      The above changed slightly the behavior of existing pktgen users,
      and made the procfs interface somewhat inconsistent.
      Fix it by restoring the previous pkt_overhead value and using
      LL_RESERVED_SPACE as extralen in skb allocation.
      Also, change pktgen_alloc_skb() to only partially reserve
      the headroom to allow the caller to prefetch from ll header
      start.
      
      v1 -> v2:
       - fixed some typos in the comments
      
      Fixes: 879c7220 ("net: pktgen: Observe needed_headroom of the device")
      Suggested-by: NBen Greear <greearb@candelatech.com>
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63d75463
    • G
      net: fec: set mac address unconditionally · b82d44d7
      Gavin Schenk 提交于
      If the mac address origin is not dt, you can only safely assign a mac
      address after "link up" of the device. If the link is off the clocks are
      disabled and because of issues assigning registers when clocks are off the
      new mac address cannot be written in .ndo_set_mac_address() on some soc's.
      This fix sets the mac address unconditionally in fec_restart(...) and
      ensures consistency between fec registers and the network layer.
      Signed-off-by: NGavin Schenk <g.schenk@eckelmann.de>
      Acked-by: NFugang Duan <fugang.duan@nxp.com>
      Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Fixes: 9638d19e ("net: fec: add netif status check before set mac address")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b82d44d7
    • B
      net: ethernet: mediatek: mark symbols static where possible · 3a82e78c
      Baoyou Xie 提交于
      We get 2 warnings when building kernel with W=1:
      drivers/net/ethernet/mediatek/mtk_eth_soc.c:2041:5: warning: no previous prototype for 'mtk_get_link_ksettings' [-Wmissing-prototypes]
      drivers/net/ethernet/mediatek/mtk_eth_soc.c:2052:5: warning: no previous prototype for 'mtk_set_link_ksettings' [-Wmissing-prototypes]
      
      In fact, these functions are only used in the file in which they are
      declared and don't need a declaration, but can be made static.
      So this patch marks these functions with 'static'.
      Signed-off-by: NBaoyou Xie <baoyou.xie@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a82e78c
    • B
      cxgb4: mark cxgb_setup_tc() static · 8efebd6e
      Baoyou Xie 提交于
      We get 1 warning when building kernel with W=1:
      drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:2715:5: warning: no previous prototype for 'cxgb_setup_tc' [-Wmissing-prototypes]
      
      In fact, this function is only used in the file in which it is
      declared and don't need a declaration, but can be made static.
      so this patch marks this function with 'static'.
      Signed-off-by: NBaoyou Xie <baoyou.xie@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8efebd6e
    • M
      ipv6 addrconf: remove addrconf_sysctl_hop_limit() · cb9e684e
      Maciej Żenczykowski 提交于
      This is an effective no-op in terms of user observable behaviour.
      
      By preventing the overwrite of non-null extra1/extra2 fields
      in addrconf_sysctl() we can enable the use of proc_dointvec_minmax().
      
      This allows us to eliminate the constant min/max (1..255) trampoline
      function that is addrconf_sysctl_hop_limit().
      
      This is nice because it simplifies the code, and allows future
      sysctls with constant min/max limits to also not require trampolines.
      
      We still can't eliminate the trampoline for mtu because it isn't
      actually a constant (it depends on other tunables of the device)
      and thus requires at-write-time logic to enforce range.
      Signed-off-by: NMaciej Żenczykowski <maze@google.com>
      Acked-by: NErik Kline <ek@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cb9e684e
    • S
      netfilter: bridge: clarify bridge/netfilter message · d4ef9f72
      Stefan Agner 提交于
      When using bridge without bridge netfilter enabled the message
      displayed is rather confusing and leads to belive that a deprecated
      feature is in use. Use IS_MODULE to be explicit that the message only
      affects users which use bridge netfilter as module and reword the
      message.
      Signed-off-by: NStefan Agner <stefan@agner.ch>
      Acked-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d4ef9f72
    • D
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · b50afd20
      David S. Miller 提交于
      Three sets of overlapping changes.  Nothing serious.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b50afd20
    • L
      Linux 4.8 · c8d2bc9b
      Linus Torvalds 提交于
      c8d2bc9b
    • L
      Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm · f76d9c61
      Linus Torvalds 提交于
      Pull ARM fixes from Russell King:
       "Three relatively small fixes for ARM:
      
         - Roger noticed that dma_max_pfn() was calculating the upper limit
           wrongly, by adding the PFN offset of memory twice.
      
         - A fix from Robin to correct parsing of MPIDR values when the
           address size is larger than one BE32 unit.
      
         - A fix from Srinivas to ensure that we do not rely on the boot
           loader (or previous Linux kernel) setting the translation table
           base register a certain way in the decompressor, which can lead to
           crashes"
      
      * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 8618/1: decompressor: reset ttbcr fields to use TTBR0 on ARMv7
        ARM: 8617/1: dma: fix dma_max_pfn()
        ARM: 8616/1: dt: Respect property size when parsing CPUs
      f76d9c61
    • S
      ARM: 8618/1: decompressor: reset ttbcr fields to use TTBR0 on ARMv7 · 117e5e9c
      Srinivas Ramana 提交于
      If the bootloader uses the long descriptor format and jumps to
      kernel decompressor code, TTBCR may not be in a right state.
      Before enabling the MMU, it is required to clear the TTBCR.PD0
      field to use TTBR0 for translation table walks.
      
      The commit dbece458 ("ARM: 7501/1: decompressor:
      reset ttbcr for VMSA ARMv7 cores") does the reset of TTBCR.N, but
      doesn't consider all the bits for the size of TTBCR.N.
      
      Clear TTBCR.PD0 field and reset all the three bits of TTBCR.N to
      indicate the use of TTBR0 and the correct base address width.
      
      Fixes: dbece458 ("ARM: 7501/1: decompressor: reset ttbcr for VMSA ARMv7 cores")
      Acked-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NSrinivas Ramana <sramana@codeaurora.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      117e5e9c
    • L
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · be67d60b
      Linus Torvalds 提交于
      Pull x86 fixes from Thomas Gleixner:
       "The last regression fixes for 4.8 final:
      
         - Two patches addressing the fallout of the CR4 optimizations which
           caused CR4-less machines to fail.
      
         - Fix the VDSO build on big endian machines
      
         - Take care of FPU initialization if no CPUID is available otherwise
           task struct size ends up being zero
      
         - Fix up context tracking in case load_gs_index fails"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/entry/64: Fix context tracking state warning when load_gs_index fails
        x86/boot: Initialize FPU and X86_FEATURE_ALWAYS even if we don't have CPUID
        x86/vdso: Fix building on big endian host
        x86/boot: Fix another __read_cr4() case on 486
        x86/init: Fix cr4_init_shadow() on CR4-less machines
      be67d60b
    • L
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 66188fb1
      Linus Torvalds 提交于
      Pull MIPS fixes from Ralf Baechle:
       "Another round of fixes:
      
         - CM: Fix mips_cm_max_vp_width for non-MT kernels on MT systems
         - CPS: Avoid BUG() when offlining pre-r6 CPUs
         - DEC: Avoid gas warnings due to suspicious instruction scheduling by
           manually expanding assembler macros.
         - FTLB: Fix configuration by moving confiuguratoin after probing
         - FTLB: clear execution hazard after changing FTLB enable
         - Highmem: Fix detection of unsupported highmem with cache aliases
         - I6400: Don't touch FTLBP chicken bits
         - microMIPS: Fix BUILD_ROLLBACK_PROLOGUE
         - Malta: Fix IOCU disable switch read for MIPS64
         - Octeon: Fix probing of devices attached to GPIO lines
         - uprobes: Misc small fixes"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: CM: Fix mips_cm_max_vp_width for non-MT kernels on MT systems
        MIPS: Fix detection of unsupported highmem with cache aliases
        MIPS: Malta: Fix IOCU disable switch read for MIPS64
        MIPS: Fix BUILD_ROLLBACK_PROLOGUE for microMIPS
        MIPS: clear execution hazard after changing FTLB enable
        MIPS: Configure FTLB after probing TLB sizes from config4
        MIPS: Stop setting I6400 FTLBP
        MIPS: DEC: Avoid la pseudo-instruction in delay slots
        MIPS: Octeon: mark GPIO controller node not populated after IRQ init.
        MIPS: uprobes: fix use of uninitialised variable
        MIPS: uprobes: remove incorrect set_orig_insn
        MIPS: fix uretprobe implementation
        MIPS: smp-cps: Avoid BUG() when offlining pre-r6 CPUs
      66188fb1
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · 0c7fc30f
      Linus Torvalds 提交于
      Pull sparc fixes from David Miller:
      
       1) Fix section mismatches in some builds, from Paul Gortmaker.
      
       2) Need to count huge zero page mappings when doing TSB sizing, from
          Mike Kravetz.
      
       3) Fix handing of cpu_possible_mask when nr_cpus module option is
          specified, from Atish Patra.
      
       4) Don't allocate irq stacks until nr_irqs has been processed, also
          from Atish Patra.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc64: Fix non-SMP build.
        sparc64: Fix irq stack bootmem allocation.
        sparc64: Fix cpu_possible_mask if nr_cpus is set
        sparc64 mm: Fix more TSB sizing issues
        sparc64: fix section mismatch in find_numa_latencies_for_group
      0c7fc30f
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · bb6bbc7c
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Fix wrong TCP checksums on MTU probing when checksum offloading is
          disabled, from Douglas Caetano dos Santos.
      
       2) Fix qdisc backlog updates in qfq and sfb schedulers, from Cong Wang.
      
       3) Route lookup flow key protocol value is wrong in ip6gre_xmit_other(),
          fix from Lance Richardson.
      
       4) Scheduling while atomic in multicast routing code of ipv4 and ipv6,
          fix from Nikolay Aleksandrov.
      
       5) Fix packet alignment in fec driver, from Eric Nelson.
      
       6) Fix perf regression in sctp due to struct layout and cache misses,
          from Xin Long.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        sctp: fix the issue sctp_diag uses lock_sock in rcu_read_lock
        sctp: change to check peer prsctp_capable when using prsctp polices
        sctp: remove prsctp_param from sctp_chunk
        sctp: move sent_count to the memory hole in sctp_chunk
        tg3: Avoid NULL pointer dereference in tg3_io_error_detected()
        act_ife: Fix false encoding
        act_ife: Fix external mac header on encode
        VSOCK: Don't dec ack backlog twice for rejected connections
        Revert "net: ethernet: bcmgenet: use phydev from struct net_device"
        net: fec: align IP header in hardware
        net: fec: remove QUIRK_HAS_RACC from i.mx27
        net: fec: remove QUIRK_HAS_RACC from i.mx25
        ipmr, ip6mr: fix scheduling while atomic and a deadlock with ipmr_get_route
        ip6_gre: fix flowi6_proto value in ip6gre_xmit_other()
        tcp: fix a compile error in DBGUNDO()
        tcp: fix wrong checksum calculation on MTU probing
        sch_sfb: keep backlog updated with qlen
        sch_qfq: keep backlog updated with qlen
        can: dev: fix deadlock reported after bus-off
      bb6bbc7c
  3. 02 10月, 2016 1 次提交
    • P
      MIPS: CM: Fix mips_cm_max_vp_width for non-MT kernels on MT systems · 6605d156
      Paul Burton 提交于
      When discovering the number of VPEs per core, smp_num_siblings will be
      incorrect for kernels built without support for the MIPS MultiThreading
      (MT) ASE running on systems which implement said ASE. This leads to
      accesses to VPEs in secondary cores being performed incorrectly since
      mips_cm_vp_id calculates the wrong ID to write to the local "other"
      registers. Fix this by examining the number of VPEs in the core as
      reported by the CM.
      
      This patch presumes that the number of VPEs will be the same in each
      core of the system. As this path only applies to systems with CM version
      2.5 or lower, and this property is true of all such known systems, this
      is likely to be fine but is described in a comment for good measure.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14338/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6605d156
  4. 01 10月, 2016 7 次提交
    • L
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · f51fdffa
      Linus Torvalds 提交于
      Pull SCSI fix from James Bottomley:
       "One final fix before 4.8.
      
        There was a memory leak triggered by turning scsi mq off due to the
        fact that we assume on host release that the already running hosts
        weren't mq based because that's the state of the global flag (even
        though they were).
      
        Fix it by tracking this on a per host host basis"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: Avoid that toggling use_blk_mq triggers a memory leak
      f51fdffa
    • T
      net: Use ns_capable_noaudit() when determining net sysctl permissions · d6169b02
      Tyler Hicks 提交于
      The capability check should not be audited since it is only being used
      to determine the inode permissions. A failed check does not indicate a
      violation of security policy but, when an LSM is enabled, a denial audit
      message was being generated.
      
      The denial audit message caused confusion for some application authors
      because root-running Go applications always triggered the denial. To
      prevent this confusion, the capability check in net_ctl_permissions() is
      switched to the noaudit variant.
      
      BugLink: https://launchpad.net/bugs/1465724Signed-off-by: NTyler Hicks <tyhicks@canonical.com>
      Acked-by: NSerge E. Hallyn <serge.hallyn@ubuntu.com>
      Signed-off-by: NJames Morris <james.l.morris@oracle.com>
      [dtor: reapplied after e79c6a4f ("net: make net namespace sysctls
      belong to container's owner") accidentally reverted the change.]
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d6169b02
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 2161a2a6
      Linus Torvalds 提交于
      Pull input fix from Dmitry Torokhov:
       "One small change to make joydev (which is used by older games) to bind
        to devices that export Z axis but not X or Y (such as TRC rudder)"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: joydev - recognize devices with Z axis as joysticks
      2161a2a6
    • L
      Merge branch 'akpm' (patches from Andrew) · dbd8805b
      Linus Torvalds 提交于
      Merge more fixes from Andrew Morton:
       "Three fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        include/linux/property.h: fix typo/compile error
        ocfs2: fix deadlock on mmapped page in ocfs2_write_begin_nolock()
        mm: workingset: fix crash in shadow node shrinker caused by replace_page_cache_page()
      dbd8805b
    • J
      include/linux/property.h: fix typo/compile error · 37aa7271
      John Youn 提交于
      This fixes commit d76eebfa ("include/linux/property.h: fix build
      issues with gcc-4.4.4").
      
      With that commit we get the following compile error when using the
      PROPERTY_ENTRY_INTEGER_ARRAY macro.
      
       include/linux/property.h:201:39: error: `u32_data' undeclared (first
                       use in this function)
        PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u32, _val_)
                                             ^
       include/linux/property.h:193:17: note: in definition of macro
                       `PROPERTY_ENTRY_INTEGER_ARRAY'
        { .pointer = { _type_##_data = _val_ } },  \
                       ^
      
      This needs a '.' to reference the union member.  It seems this was just
      overlooked here since it is done correctly in similar constructs in
      other parts of the original commit.
      
      This fix is in preparation of upcoming commits that will use this macro.
      
      Fixes: commit d76eebfa ("include/linux/property.h: fix build issues with gcc-4.4.4")
      Link: http://lkml.kernel.org/r/2de3b929290d88a723ed829a3e3cbd02044714df.1475114627.git.johnyoun@synopsys.comSigned-off-by: NJohn Youn <johnyoun@synopsys.com>
      Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      37aa7271
    • E
      ocfs2: fix deadlock on mmapped page in ocfs2_write_begin_nolock() · c33f0785
      Eric Ren 提交于
      The testcase "mmaptruncate" of ocfs2-test deadlocks occasionally.
      
      In this testcase, we create a 2*CLUSTER_SIZE file and mmap() on it;
      there are 2 process repeatedly performing the following operations
      respectively: one is doing memset(mmaped_addr + 2*CLUSTER_SIZE - 1, 'a',
      1), while the another is playing ftruncate(fd, 2*CLUSTER_SIZE) and then
      ftruncate(fd, CLUSTER_SIZE) again and again.
      
      This is the backtrace when the deadlock happens:
      
         __wait_on_bit_lock+0x50/0xa0
         __lock_page+0xb7/0xc0
         ocfs2_write_begin_nolock+0x163f/0x1790 [ocfs2]
         ocfs2_page_mkwrite+0x1c7/0x2a0 [ocfs2]
         do_page_mkwrite+0x66/0xc0
         handle_mm_fault+0x685/0x1350
         __do_page_fault+0x1d8/0x4d0
         trace_do_page_fault+0x37/0xf0
         do_async_page_fault+0x19/0x70
         async_page_fault+0x28/0x30
      
      In ocfs2_write_begin_nolock(), we first grab the pages and then allocate
      disk space for this write; ocfs2_try_to_free_truncate_log() will be
      called if -ENOSPC is returned; if we're lucky to get enough clusters,
      which is usually the case, we start over again.
      
      But in ocfs2_free_write_ctxt() the target page isn't unlocked, so we
      will deadlock when trying to grab the target page again.
      
      Also, -ENOMEM might be returned in ocfs2_grab_pages_for_write().
      Another deadlock will happen in __do_page_mkwrite() if
      ocfs2_page_mkwrite() returns non-VM_FAULT_LOCKED, and along with a
      locked target page.
      
      These two errors fail on the same path, so fix them by unlocking the
      target page manually before ocfs2_free_write_ctxt().
      
      Jan Kara helps me clear out the JBD2 part, and suggest the hint for root
      cause.
      
      Changes since v1:
      1. Also put ENOMEM error case into consideration.
      
      Link: http://lkml.kernel.org/r/1474173902-32075-1-git-send-email-zren@suse.comSigned-off-by: NEric Ren <zren@suse.com>
      Reviewed-by: NHe Gang <ghe@suse.com>
      Acked-by: NJoseph Qi <joseph.qi@huawei.com>
      Cc: Mark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c33f0785
    • J
      mm: workingset: fix crash in shadow node shrinker caused by replace_page_cache_page() · 22f2ac51
      Johannes Weiner 提交于
      Antonio reports the following crash when using fuse under memory pressure:
      
        kernel BUG at /build/linux-a2WvEb/linux-4.4.0/mm/workingset.c:346!
        invalid opcode: 0000 [#1] SMP
        Modules linked in: all of them
        CPU: 2 PID: 63 Comm: kswapd0 Not tainted 4.4.0-36-generic #55-Ubuntu
        Hardware name: System manufacturer System Product Name/P8H67-M PRO, BIOS 3904 04/27/2013
        task: ffff88040cae6040 ti: ffff880407488000 task.ti: ffff880407488000
        RIP: shadow_lru_isolate+0x181/0x190
        Call Trace:
          __list_lru_walk_one.isra.3+0x8f/0x130
          list_lru_walk_one+0x23/0x30
          scan_shadow_nodes+0x34/0x50
          shrink_slab.part.40+0x1ed/0x3d0
          shrink_zone+0x2ca/0x2e0
          kswapd+0x51e/0x990
          kthread+0xd8/0xf0
          ret_from_fork+0x3f/0x70
      
      which corresponds to the following sanity check in the shadow node
      tracking:
      
        BUG_ON(node->count & RADIX_TREE_COUNT_MASK);
      
      The workingset code tracks radix tree nodes that exclusively contain
      shadow entries of evicted pages in them, and this (somewhat obscure)
      line checks whether there are real pages left that would interfere with
      reclaim of the radix tree node under memory pressure.
      
      While discussing ways how fuse might sneak pages into the radix tree
      past the workingset code, Miklos pointed to replace_page_cache_page(),
      and indeed there is a problem there: it properly accounts for the old
      page being removed - __delete_from_page_cache() does that - but then
      does a raw raw radix_tree_insert(), not accounting for the replacement
      page.  Eventually the page count bits in node->count underflow while
      leaving the node incorrectly linked to the shadow node LRU.
      
      To address this, make sure replace_page_cache_page() uses the tracked
      page insertion code, page_cache_tree_insert().  This fixes the page
      accounting and makes sure page-containing nodes are properly unlinked
      from the shadow node LRU again.
      
      Also, make the sanity checks a bit less obscure by using the helpers for
      checking the number of pages and shadows in a radix tree node.
      
      Fixes: 449dd698 ("mm: keep page cache radix tree nodes in check")
      Link: http://lkml.kernel.org/r/20160919155822.29498-1-hannes@cmpxchg.orgSigned-off-by: NJohannes Weiner <hannes@cmpxchg.org>
      Reported-by: NAntonio SJ Musumeci <trapexit@spawn.link>
      Debugged-by: NMiklos Szeredi <miklos@szeredi.hu>
      Cc: <stable@vger.kernel.org>	[3.15+]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      22f2ac51