Skip to content
  1. May 17, 2015
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 148c46f3
      Linus Torvalds authored
      Pull char/misc fix from Greg KH:
       "Here is one fix, in the extcon subsystem, that resolves a reported
        issue.
      
        It's been in linux-next for a number of weeks now, sorry for not
        getting it to you sooner"
      
      * tag 'char-misc-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        extcon: usb-gpio: register extcon device before IRQ registration
      148c46f3
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml · 92752b5c
      Linus Torvalds authored
      Pull UML hostfs fix from Richard Weinberger:
       "This contains a single fix for a regression introduced in 4.1-rc1"
      
      * 'for-linus-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
        hostfs: Use correct mask for file mode
      92752b5c
    • Linus Torvalds's avatar
      Merge tag 'upstream-4.1-rc4' of git://git.infradead.org/linux-ubifs · 1630ee5e
      Linus Torvalds authored
      Pull UBI bufix from Richard Weinberger:
       "This contains a single bug fix for the UBI block driver"
      
      * tag 'upstream-4.1-rc4' of git://git.infradead.org/linux-ubifs:
        UBI: block: Add missing cache flushes
      1630ee5e
    • Linus Torvalds's avatar
      Merge tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 6a8098a4
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "Fix a number of ext4 bugs; the most serious of which is a bug in the
        lazytime mount optimization code where we could end up updating the
        timestamps to the wrong inode"
      
      * tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: fix an ext3 collapse range regression in xfstests
        jbd2: fix r_count overflows leading to buffer overflow in journal recovery
        ext4: check for zero length extent explicitly
        ext4: fix NULL pointer dereference when journal restart fails
        ext4: remove unused function prototype from ext4.h
        ext4: don't save the error information if the block device is read-only
        ext4: fix lazytime optimization
      6a8098a4
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · c7309e88
      Linus Torvalds authored
      Pull btrfs fixes from Chris Mason:
       "The first commit is a fix from Filipe for a very old extent buffer
        reuse race that triggered a BUG_ON.  It hasn't come up often, I looked
        through old logs at FB and we hit it a handful of times over the last
        year.
      
        The rest are other corners he hit during testing"
      
      * 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        Btrfs: fix race when reusing stale extent buffers that leads to BUG_ON
        Btrfs: fix race between block group creation and their cache writeout
        Btrfs: fix panic when starting bg cache writeout after IO error
        Btrfs: fix crash after inode cache writeback failure
      c7309e88
    • Linus Torvalds's avatar
      Merge branch 'master' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 518af3cb
      Linus Torvalds authored
      Pull MIPS fixes from Ralf Baechle:
       "Seven small fixes.  The shortlog below is a good description so no
        need to elaborate.
      
        It has sat in linux-next and survived the usual automated testing by
        Imagination's test farm"
      
      * 'master' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: tlb-r4k: Fix PG_ELPA comment
        MIPS: Fix up obsolete cpu_set usage
        MIPS: IP32: Fix build errors in reset code in DS1685 platform hook.
        MIPS: KVM: Fix unused variable build warning
        MIPS: traps: remove extra Tainted: line from __show_regs() output
        MIPS: Fix wrong CHECKFLAGS (sparse builds) with GCC 5.1
        MIPS: Fix a preemption issue with thread's FPU defaults
      518af3cb
    • Linus Torvalds's avatar
      Merge tag 'arc-4.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc · 2ed3d795
      Linus Torvalds authored
      Pull ARC fixes from Vineet Gupta.
      
      * tag 'arc-4.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
        ARC: inline cache flush toggle helpers
        ARC: With earlycon in use, retire EARLY_PRINTK
        ARC: unbork !LLSC build
      2ed3d795
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · d6610270
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "Nothing frightening this time, just smaller fixes in a number of
        places.
      
        The other changes contained here are:
      
         MAINTAINERS file updates:
      
         - The mach-gemini maintainer is back in action and has a new git tree
      
         - Krzysztof Kozlowski has volunteered to be a new co-maintainer for
           the samsung platforms
      
         - updates to the files that belong to Marvell mvebu
      
        Bug fixes:
      
         - The largest changes are on omap2, but are only to avoid some
           harmless warnings and to fix reset on omap4
      
         - a small regression fix on tegra
      
         - multiple fixes for incorrect IRQ affinity on vexpress
      
         - the missing system controller on arm64 juno is added
      
         - one revert of a patch that was accidentally applied twice for
           mach-rockchip
      
         - two clock related DT fixes for mvebu
      
         - a workaround for suspend with old DT binaries on new exynos kernels
      
         - Another fix for suspend on exynos, needs to be backported"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (21 commits)
        MAINTAINERS: Add dts entries for some of the Marvell SoCs
        MAINTAINERS: ARM: EXYNOS: Add Krzysztof Kozlowski as co-maintainer
        ARM: EXYNOS: Use of_machine_is_compatible instead of soc_is_exynos4
        ARM: EXYNOS: Fix failed second suspend on Exynos4
        Revert "ARM: rockchip: fix undefined instruction of reset_ctrl_regs"
        ARM: EXYNOS: Fix dereference of ERR_PTR returned by of_genpd_get_from_provider
        ARM: EXYNOS: Don't try to initialize suspend on old DT
        ARM: dts: Add keep-power-in-suspend to WiFi SDIO node for Peach Boards
        ARM: gemini: fix compiler warning due wrong data type
        ARM: vexpress/tc2: Add interrupt-affinity to the PMU node
        ARM: vexpress/ca9: Add interrupt-affinity to the PMU node
        ARM: vexpress/ca9: Add unified-cache property to l2 cache node
        ARM64: juno: add sp810 support and fix sp804 clock frequency
        ARM: Gemini: Maintainers update
        ARM: OMAP2+: Remove bogus struct clk comparison for timer clock
        ARM: dove: Add clock-names to CuBox Si5351 clk generator
        ARM: AM33xx+: hwmod: re-use omap4 implementations for reset functionality
        ARM: OMAP4+: PRM: add support for passing status register/bit info to reset
        ARM: AM43xx: hwmod: add VPFE hwmod entries
        ARM: mvebu: Fix the main PLL frequency on Armada 375, 38x and 39x SoCs
        ...
      d6610270
    • Linus Torvalds's avatar
      Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux · 73786683
      Linus Torvalds authored
      Pull thermal fixes from Zhang Rui:
       "Specifics:
      
         - fix an issue in intel_powerclamp driver that idle injection target
           is not accurately maintained on newer Intel CPUs.  Package C8 to
           C10 states are introduced on these CPUs but they were not included
           in the package c-state residency calculation.  From Jacob Pan.
      
         - fix a problem that package c-state idle injection was missing on
           Broadwell server, by adding its id to intel_powerclamp driver.
           From Jacob Pan.
      
         - a couple of small fixes and cleanups from Joe Perches, Mathias
           Krause, Dan Carpenter and Anand Moon"
      
      * 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
        tools/thermal: tmon: fixed the 'make install' command
        thermal: rockchip: fix an error code
        thermal/powerclamp: fix missing newer package c-states
        thermal/intel_powerclamp: add id for broadwell server
        thermal/intel_powerclamp: add __init / __exit annotations
        thermal: Use bool function return values of true/false not 1/0
      73786683
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-4.1-rc4' of... · d70933be
      Linus Torvalds authored
      Merge tag 'linux-kselftest-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull kselftest fixes from Shuah Khan:
       "Urgent fix for Kselftest regression introduced in 4.1-rc1 by the new
        x86 test due to its hard dependency on 32-bit build environment.
      
        A set of 5 patches fix the make kselftest run and kselftest install"
      
      * tag 'linux-kselftest-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests, x86: Rework x86 target architecture detection
        selftests, x86: Remove useless run_tests rule
        selftests/x86: install tests
        selftest/x86: have no dependency on all when cross building
        selftest/x86: build both bitnesses
      d70933be
  2. May 16, 2015
  3. May 15, 2015
    • Arnd Bergmann's avatar
      Merge tag 'samsung-fixes-2' of... · 56523eef
      Arnd Bergmann authored
      Merge tag 'samsung-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into fixes
      
      Merge "Samsung 2nd fixes for v4.1" from Kukjin Kim:
      
      - fix second S2R on exynos4412 based Trats2, Odroid U3 boards which
        happened after enabling L2$ and caused by commit 13cfa6c4 ("ARM:
        EXYNOS: Fix CPU idle clock down after CPU off")
        And replace the soc_is_exynosxxx() macro with of_compatible_xxx
      
      - fix dereference of ERR_PTR of of_genpd_get_from_provider()
      
      - fix suspend problem on old DT machines to skip the initialization
        suspend and caused by commit 8b283c02 ("ARM: exynos4/5: convert
        pmu wakeup to stacked domains")
      
      - add keep-power-in-suspend for Peach Boards to support S2R and has
        been missed in previous pull-request for fixes
      
      * tag 'samsung-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
        ARM: EXYNOS: Use of_machine_is_compatible instead of soc_is_exynos4
        ARM: EXYNOS: Fix failed second suspend on Exynos4
        ARM: EXYNOS: Fix dereference of ERR_PTR returned by of_genpd_get_from_provider
        ARM: EXYNOS: Don't try to initialize suspend on old DT
        ARM: dts: Add keep-power-in-suspend to WiFi SDIO node for Peach Boards
      56523eef
    • Arnd Bergmann's avatar
      Merge tag 'mvebu-fixes-4.1-2' of git://git.infradead.org/linux-mvebu into fixes · cc1c1b5d
      Arnd Bergmann authored
      Merge "mvebu fixes for 4.1 (part 2)" from Gregory CLEMENT:
      
      Fix the main PLL frequency on Armada 375, 38x and 39x SoCs
      Add clock-names to CuBox Si5351 clk generator
      Add dts entries in the MAINTAINERS file
      
      * tag 'mvebu-fixes-4.1-2' of git://git.infradead.org/linux-mvebu:
        MAINTAINERS: Add dts entries for some of the Marvell SoCs
        ARM: dove: Add clock-names to CuBox Si5351 clk generator
        ARM: mvebu: Fix the main PLL frequency on Armada 375, 38x and 39x SoCs
      cc1c1b5d
    • Gregory CLEMENT's avatar
      MAINTAINERS: Add dts entries for some of the Marvell SoCs · 31c17ac9
      Gregory CLEMENT authored
      
      
      Since many releases, the modifications of the mvebu and berlin device
      tree files are merged through the mvebu subsystem. This patch makes it
      official in order to help the contributors using the get_maintainer.pl
      to find the accurate peoples.
      
      In the same time, updated the mvebu description which now includes the
      kirkwood SoCs and new Armada SoCs.
      
      Signed-off-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      Acked-by: default avatarSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Acked-by: default avatarJason Cooper <jason@lakedaemon.net>
      Acked-by: default avatarAndrew Lunn <andrew@lunn.ch>
      31c17ac9
    • Ingo Molnar's avatar
      Merge branch 'liblockdep-fixes' of... · 60d5ddea
      Ingo Molnar authored
      Merge branch 'liblockdep-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux
      
       into perf/urgent
      
      Pull liblockdep fixes from Sasha Levin:
      
       "two fixes that deal with compilation errors in liblockdep."
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      60d5ddea
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2015-05-13' of git://anongit.freedesktop.org/drm-intel into drm-fixes · 47231324
      Dave Airlie authored
      fix one gpu hang on resume.
      
      * tag 'drm-intel-fixes-2015-05-13' of git://anongit.freedesktop.org/drm-intel:
        drm/i915: Avoid GPU hang when coming out of s3 or s4
      47231324
    • Dave Airlie's avatar
      Merge branch 'drm-fixes-4.1' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · e52f649e
      Dave Airlie authored
      radeon minor fixes, and pci id addition.
      * 'drm-fixes-4.1' of git://people.freedesktop.org/~agd5f/linux:
        drm/radeon: don't do mst probing if MST isn't enabled.
        drm/radeon: add new bonaire pci id
        drm/radeon: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling
      e52f649e
    • Theodore Ts'o's avatar
      ext4: fix an ext3 collapse range regression in xfstests · b9576fc3
      Theodore Ts'o authored
      The xfstests test suite assumes that an attempt to collapse range on
      the range (0, 1) will return EOPNOTSUPP if the file system does not
      support collapse range.  Commit 280227a7
      
      : "ext4: move check under
      lock scope to close a race" broke this, and this caused xfstests to
      fail when run when testing file systems that did not have the extents
      feature enabled.
      
      Reported-by: default avatarEric Whitney <enwlinux@gmail.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      b9576fc3
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · f0897f4c
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "Two fixes here, one revert of a recent ACPICA commit that broke audio
        support on one Dell machine and a fix for a long-standing issue that
        may cause systems to break randomly during boot.
      
        Specifics:
      
         - The recent ACPICA commit that set the ACPI _REV return value to 2
           (which is the value always used by Windows and now mandated by the
           spec too) in order to prevent the firmware people from using it to
           play tricks with us caused a serious audio regression to happen on
           Dell XPS 13 (the AML on that machine uses the _REV return value to
           decide how to expose audio to the OS and does that to hide the lack
           of proper support for its I2S audio in Linux), so revert that
           commit for now and we'll revisit the issue in the next cycle.
      
         - Ensure that the ordering of acpi_reserve_resources() with respect
           to the rest of the ACPI initialization sequence will always be the
           same, or the IO or memory region occupied by the ACPI fixed
           registers may be assigned to a PCI host bridge as a result of a
           race and random breakage ensues going forward"
      
      * tag 'pm+acpi-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        Revert "ACPICA: Permanently set _REV to the value '2'."
        ACPI / init: Fix the ordering of acpi_reserve_resources()
      f0897f4c
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · fc8c540b
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
      
       - fix potential memory leak in perf PMU probing
      
       - BPF sign extension fix for 64-bit immediates
      
       - fix build failure with unusual configuration
      
       - revert unused and broken branch patching from alternative code
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: perf: fix memory leak when probing PMU PPIs
        arm64: bpf: fix signedness bug in loading 64-bit immediate
        arm64: mm: Fix build error with CONFIG_SPARSEMEM_VMEMMAP disabled
        Revert "arm64: alternative: Allow immediate branch as alternative instruction"
      fc8c540b
    • Linus Torvalds's avatar
      Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging · 3c25a75e
      Linus Torvalds authored
      Pull dmi fixes from Jean Delvare.
      
      * 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
        firmware: dmi_scan: Fix ordering of product_uuid
        firmware: dmi_scan: Simplified displayed version
      3c25a75e
    • Mel Gorman's avatar
      mm, numa: really disable NUMA balancing by default on single node machines · b0dc2b9b
      Mel Gorman authored
      
      
      NUMA balancing is meant to be disabled by default on UMA machines but
      the check is using nr_node_ids (highest node) instead of
      num_online_nodes (online nodes).
      
      The consequences are that a UMA machine with a node ID of 1 or higher
      will enable NUMA balancing.  This will incur useless overhead due to
      minor faults with the impact depending on the workload.  These are the
      impact on the stats when running a kernel build on a single node machine
      whose node ID happened to be 1:
      
        			       vanilla     patched
        NUMA base PTE updates          5113158           0
        NUMA huge PMD updates              643           0
        NUMA page range updates        5442374           0
        NUMA hint faults               2109622           0
        NUMA hint local faults         2109622           0
        NUMA hint local percent            100         100
        NUMA pages migrated                  0           0
      
      Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
      Reviewed-by: default avatarRik van Riel <riel@redhat.com>
      Cc: <stable@vger.kernel.org>	[3.8+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b0dc2b9b
    • Jingoo Han's avatar
      MAINTAINERS: update Jingoo Han's email address · b7701755
      Jingoo Han authored
      
      
      Change my private email address.
      
      Signed-off-by: default avatarJingoo Han <jingoohan1@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b7701755
    • Hui Zhu's avatar
      CMA: page_isolation: check buddy before accessing it · 1ae7013d
      Hui Zhu authored
      I had an issue:
      
          Unable to handle kernel NULL pointer dereference at virtual address 0000082a
          pgd = cc970000
          [0000082a] *pgd=00000000
          Internal error: Oops: 5 [#1] PREEMPT SMP ARM
          PC is at get_pageblock_flags_group+0x5c/0xb0
          LR is at unset_migratetype_isolate+0x148/0x1b0
          pc : [<c00cc9a0>]    lr : [<c0109874>]    psr: 80000093
          sp : c7029d00  ip : 00000105  fp : c7029d1c
          r10: 00000001  r9 : 0000000a  r8 : 00000004
          r7 : 60000013  r6 : 000000a4  r5 : c0a357e4  r4 : 00000000
          r3 : 00000826  r2 : 00000002  r1 : 00000000  r0 : 0000003f
          Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
          Control: 10c5387d  Table: 2cb7006a  DAC: 00000015
          Backtrace:
              get_pageblock_flags_group+0x0/0xb0
              unset_migratetype_isolate+0x0/0x1b0
              undo_isolate_page_range+0x0/0xdc
              __alloc_contig_range+0x0/0x34c
              alloc_contig_range+0x0/0x18
      
      This issue is because when calling unset_migra...
      1ae7013d
    • Josh Triplett's avatar
      uidgid: make uid_valid and gid_valid work with !CONFIG_MULTIUSER · 929aa5b2
      Josh Triplett authored
      
      
      {u,g}id_valid call {u,g}id_eq, which calls __k{u,g}id_val on both
      arguments and compares.  With !CONFIG_MULTIUSER, __k{u,g}id_val return a
      constant 0, which makes {u,g}id_valid always return false.  Change
      {u,g}id_valid to compare their argument against -1 instead.  That produces
      identical results in the normal CONFIG_MULTIUSER=y case, but with
      !CONFIG_MULTIUSER will make {u,g}id_valid constant-fold into "return
      true;" rather than "return false;".
      
      This fixes uses of devpts without CONFIG_MULTIUSER.
      
      Signed-off-by: default avatarJosh Triplett <josh@joshtriplett.org>
      Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com&gt;,>
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      929aa5b2
    • Vladimir Davydov's avatar
      kernfs: do not account ino_ida allocations to memcg · 499611ed
      Vladimir Davydov authored
      
      
      root->ino_ida is used for kernfs inode number allocations. Since IDA has
      a layered structure, different IDs can reside on the same layer, which
      is currently accounted to some memory cgroup. The problem is that each
      kmem cache of a memory cgroup has its own directory on sysfs (under
      /sys/fs/kernel/<cache-name>/cgroup). If the inode number of such a
      directory or any file in it gets allocated from a layer accounted to the
      cgroup which the cache is created for, the cgroup will get pinned for
      good, because one has to free all kmem allocations accounted to a cgroup
      in order to release it and destroy all its kmem caches. That said we
      must not account layers of ino_ida to any memory cgroup.
      
      Since per net init operations may create new sysfs entries directly
      (e.g. lo device) or indirectly (nf_conntrack creates a new kmem cache
      per each namespace, which, in turn, creates new sysfs entries), an easy
      way to reproduce this issue is by creating network namespace(s) from
      inside a kmem-active memory cgroup.
      
      Signed-off-by: default avatarVladimir Davydov <vdavydov@parallels.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: <stable@vger.kernel.org>	[4.0.x]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      499611ed
    • Vladimir Davydov's avatar
      gfp: add __GFP_NOACCOUNT · 8f4fc071
      Vladimir Davydov authored
      
      
      Not all kmem allocations should be accounted to memcg.  The following
      patch gives an example when accounting of a certain type of allocations to
      memcg can effectively result in a memory leak.  This patch adds the
      __GFP_NOACCOUNT flag which if passed to kmalloc and friends will force the
      allocation to go through the root cgroup.  It will be used by the next
      patch.
      
      Note, since in case of kmemleak enabled each kmalloc implies yet another
      allocation from the kmemleak_object cache, we add __GFP_NOACCOUNT to
      gfp_kmemleak_mask.
      
      Alternatively, we could introduce a per kmem cache flag disabling
      accounting for all allocations of a particular kind, but (a) we would not
      be able to bypass accounting for kmalloc then and (b) a kmem cache with
      this flag set could not be merged with a kmem cache without this flag,
      which would increase the number of global caches and therefore
      fragmentation even if the memory cgroup controller is not used.
      
      Despite its generic name, currently __GFP_NOACCOUNT disables accounting
      only for kmem allocations while user page allocations are always charged.
      To catch abusing of this flag, a warning is issued on an attempt of
      passing it to mem_cgroup_try_charge.
      
      Signed-off-by: default avatarVladimir Davydov <vdavydov@parallels.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: <stable@vger.kernel.org>	[4.0.x]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8f4fc071
    • Andi Kleen's avatar
      tools/vm: fix page-flags build · 4933f55f
      Andi Kleen authored
      
      
      libabikfs.a doesn't exist anymore, so we now need to link with libapi.a.
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      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>
      4933f55f
    • Andrew Morton's avatar
      drivers/rtc/rtc-armada38x.c: remove unused local `flags' · f98b733e
      Andrew Morton authored
      
      
      Reported-by: default avatarFengguang Wu <fengguang.wu@gmail.com>
      Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f98b733e
    • Darrick J. Wong's avatar
      jbd2: fix r_count overflows leading to buffer overflow in journal recovery · e531d0bc
      Darrick J. Wong authored
      
      
      The journal revoke block recovery code does not check r_count for
      sanity, which means that an evil value of r_count could result in
      the kernel reading off the end of the revoke table and into whatever
      garbage lies beyond.  This could crash the kernel, so fix that.
      
      However, in testing this fix, I discovered that the code to write
      out the revoke tables also was not correctly checking to see if the
      block was full -- the current offset check is fine so long as the
      revoke table space size is a multiple of the record size, but this
      is not true when either journal_csum_v[23] are set.
      
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Cc: stable@vger.kernel.org
      e531d0bc
    • Eryu Guan's avatar
      ext4: check for zero length extent explicitly · 2f974865
      Eryu Guan authored
      The following commit introduced a bug when checking for zero length extent
      
      5946d089
      
       ext4: check for overlapping extents in ext4_valid_extent_entries()
      
      Zero length extent could pass the check if lblock is zero.
      
      Adding the explicit check for zero length back.
      
      Signed-off-by: default avatarEryu Guan <guaneryu@gmail.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      2f974865
    • Lukas Czerner's avatar
      ext4: fix NULL pointer dereference when journal restart fails · 9d506594
      Lukas Czerner authored
      Currently when journal restart fails, we'll have the h_transaction of
      the handle set to NULL to indicate that the handle has been effectively
      aborted. We handle this situation quietly in the jbd2_journal_stop() and just
      free the handle and exit because everything else has been done before we
      attempted (and failed) to restart the journal.
      
      Unfortunately there are a number of problems with that approach
      introduced with commit
      
      41a5b913
      
       "jbd2: invalidate handle if jbd2_journal_restart()
      fails"
      
      First of all in ext4 jbd2_journal_stop() will be called through
      __ext4_journal_stop() where we would try to get a hold of the superblock
      by dereferencing h_transaction which in this case would lead to NULL
      pointer dereference and crash.
      
      In addition we're going to free the handle regardless of the refcount
      which is bad as well, because others up the call chain will still
      reference the handle so we might potentially reference already freed
      memory.
      
      Moreover it's expected that we'll get aborted handle as well as detached
      handle in some of the journalling function as the error propagates up
      the stack, so it's unnecessary to call WARN_ON every time we get
      detached handle.
      
      And finally we might leak some memory by forgetting to free reserved
      handle in jbd2_journal_stop() in the case where handle was detached from
      the transaction (h_transaction is NULL).
      
      Fix the NULL pointer dereference in __ext4_journal_stop() by just
      calling jbd2_journal_stop() quietly as suggested by Jan Kara. Also fix
      the potential memory leak in jbd2_journal_stop() and use proper
      handle refcounting before we attempt to free it to avoid use-after-free
      issues.
      
      And finally remove all WARN_ON(!transaction) from the code so that we do
      not get random traces when something goes wrong because when journal
      restart fails we will get to some of those functions.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      9d506594