01 Jul, 2012

14 commits

  • As the part of the effort to enable SPARE_IRQ for imx platform,
    the macro MXC_INTERNAL_IRQS will be removed. The imx serial driver
    has a references to it for a decision on flags of request_irq call
    based on rtsirq is beyond MXC_INTERNAL_IRQS. However the searching
    on imx platform code tells that rtsirq will never be beyond
    MXC_INTERNAL_IRQS. That said, the check, consequently the reference
    to MXC_INTERNAL_IRQS are not needed, so remove them.

    Signed-off-by: Shawn Guo
    Cc: linux-serial@vger.kernel.org
    Acked-by: Greg Kroah-Hartman
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • Remove unneeded mach/irq.h inclusion from imx platform code.

    Signed-off-by: Shawn Guo
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • Remove unneeded mach/irq.h inclusion from i2c-imx driver.

    Signed-off-by: Shawn Guo
    Cc: linux-i2c@vger.kernel.org
    Acked-by: Wolfram Sang
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • Call irq_alloc_descs to get the irq_base for mx31ads, and add a legacy
    irqdomain using the irq_base, so that the mapping between mx31ads
    hardware irq and Linux irq number can be dynamically handled by
    irqdomain. As the result, the use of MXC_BOARD_IRQ_START can be
    completely removed from mach-mx31ads.c.

    Signed-off-by: Shawn Guo
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • Call irq_alloc_descs to get the irq_base for 3ds_debugboard, and add
    a legacy irqdomain using the irq_base, so that the mapping between
    3ds_debugboard hardware irq and Linux irq number can be dynamically
    handled by irqdomain. As the result, the use of MXC_BOARD_IRQ_START
    can be completely removed from 3ds_debugboard.c.

    Signed-off-by: Shawn Guo
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • Change mxc_expio_init interface a little bit to have gpio than irq
    number passed in. With the change, gpio_to_irq can be called inside
    mxc_expio_init to get irq number, so that MXC_IRQ_TO_GPIO can be
    removed.

    Signed-off-by: Shawn Guo
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • With commit d1738ae (mfd: Allocate wm835x irq descs dynamically) being
    in the tree, there is no need to initialize irq_base field of struct
    wm8350_platform_data. Remove it to save one reference to macro
    MXC_BOARD_IRQ_START.

    Signed-off-by: Shawn Guo
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • The struct ipu_platform_data is used by platform code to pass
    MXC_IPU_IRQ_START to ipu-core driver. We can save it by having
    ipu-core driver call irq_alloc_descs to get the irq_base.

    Signed-off-by: Shawn Guo
    Acked-by: Vinod Koul
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • Move irq_domain_add_legacy call from imx27-dt.c into avic init function
    and have the avic driver adopt irqdomain support for both DT and non-DT
    boot.

    Now avic init function calls irq_alloc_descs to get irq_base and adds
    a lenacy irqdomain with the irq_base, so that the mapping between avic
    irq and Linux irq number can be handled by irqdomain.

    Signed-off-by: Shawn Guo
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • Move irq_domain_add_legacy call from imx5*-dt.c into tzic init function
    and have the tzic driver adopt irqdomain support for both DT and non-DT
    boot.

    Now tzic init function calls irq_alloc_descs to get irq_base and adds
    a lenacy irqdomain with the irq_base, so that the mapping between tzic
    irq and Linux irq number can be handled by irqdomain.

    Signed-off-by: Shawn Guo
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • Move irq_domain_add_legacy call from imx*-dt.c into gpio driver and
    have the gpio driver adopt irqdomain support for both DT and non-DT
    boot.

    With all imx platform code converted from static gpio irq number
    computation to use run-time gpio_to_irq call, we can now use
    irq_alloc_descs and irqdomain support to dynamically get irq_base
    and have the mapping between gpio and irq number available without
    using virtual_irq_start and MXC_GPIO_IRQ_START.

    Signed-off-by: Shawn Guo
    Cc: Grant Likely
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • This patch changes all the static gpio irq number assigning with
    IRQ_GPIOA() ... IRQ_GPIOF() to run-time assigning with gpio_to_irq
    call, and in turn eliminates these macros.

    Signed-off-by: Shawn Guo
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • This patch changes all the static gpio irq number assigning with
    IOMUX_TO_IRQ() to run-time assigning with gpio_to_irq call, and
    in turn eliminates the macro IOMUX_TO_IRQ().

    Signed-off-by: Shawn Guo
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo
     
  • This patch changes all the static gpio irq number assigning with
    IMX_GPIO_TO_IRQ() to run-time assigning with gpio_to_irq call, and
    in turn eliminates the macro IMX_GPIO_TO_IRQ().

    Signed-off-by: Shawn Guo
    Acked-by: Sascha Hauer

    Shawn Guo
     

09 Jun, 2012

14 commits

  • Linus Torvalds
     
  • If the privileges given to root threads (3% of allowable memory) or a
    negative value of /proc/pid/oom_score_adj happen to exceed the amount of
    rss of a thread, its badness score overflows as a result of commit
    a7f638f999ff ("mm, oom: normalize oom scores to oom_score_adj scale only
    for userspace").

    Fix this by making the type signed and return 1, meaning the thread is
    still eligible for kill, if the value is negative.

    Reported-by: Dave Jones
    Acked-by: Oleg Nesterov
    Signed-off-by: David Rientjes
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • Pull scheduler fixes from Ingo Molnar.

    * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    sched: Fix the relax_domain_level boot parameter
    sched: Validate assumptions in sched_init_numa()
    sched: Always initialize cpu-power
    sched: Fix domain iteration
    sched/rt: Fix lockdep annotation within find_lock_lowest_rq()
    sched/numa: Load balance between remote nodes
    sched/x86: Calculate booted cores after construction of sibling_mask

    Linus Torvalds
     
  • Fix lots of new kernel-doc warnings in kernel/sched/fair.c:

    Warning(kernel/sched/fair.c:3625): No description found for parameter 'env'
    Warning(kernel/sched/fair.c:3625): Excess function parameter 'sd' description in 'update_sg_lb_stats'
    Warning(kernel/sched/fair.c:3735): No description found for parameter 'env'
    Warning(kernel/sched/fair.c:3735): Excess function parameter 'sd' description in 'update_sd_pick_busiest'
    Warning(kernel/sched/fair.c:3735): Excess function parameter 'this_cpu' description in 'update_sd_pick_busiest'
    .. more warnings

    Signed-off-by: Randy Dunlap
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • This reverts commit 9e612a008fa7fe493a473454def56aa321479495.

    It incorrectly finds VGA connectors where none are attached, apparently
    not noticing that nothing replied to the EDID queries, and happily using
    the default EDID modes that have nothing to do with actual hardware.

    That in turn then causes X to fall down to the lowest common
    denominator, which is usually the default 1024x768 mode that is in the
    default EDID and pretty much anything supports).

    I'd suggest that if not relying on the HDP pin, the code should at least
    check whether it gets valid EDID data back, rather than just assume
    there's something on the VGA connector.

    Cc: Dave Airlie
    Cc: Chris Wilson
    Cc: Daniel Vetter
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Pull ext4 bug fixes from Theodore Ts'o:
    "This update contains two bug fixes, both destined for the stable tree.
    Perhaps the most important is one which fixes ext4 when used with file
    systems originally formatted for use with ext3, but then later
    converted to take advantage of ext4."

    * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
    ext4: don't set i_flags in EXT4_IOC_SETFLAGS
    ext4: fix the free blocks calculation for ext3 file systems w/ uninit_bg

    Linus Torvalds
     
  • Pull powerpc fixes from Paul Mackerras:
    "Two small fixes for powerpc:
    - a fix for a regression since 3.2 that causes 4-second (or longer)
    pauses
    - a fix for a potential oops when loading kernel modules on 32-bit
    embedded systems."

    * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
    powerpc: Fix kernel panic during kernel module load
    powerpc/time: Sanity check of decrementer expiration is necessary

    Linus Torvalds
     
  • Pull UBI/UBIFS fixes from Artem Bityutskiy:
    "Fix UBI and UBIFS - they refuse to work without debugfs. This was
    broken by the 3.5-rc1 UBI/UBIFS changes when we removed the debugging
    Kconfig switches.

    Also, correct locking in 'ubi_wl_flush()' - it was extended to support
    flushing a specific LEB in 3.5-rc1, and the locking was sub-optimal."

    * tag 'upstream-3.5-rc2' of git://git.infradead.org/linux-ubifs:
    UBI: correct ubi_wl_flush locking
    UBIFS: fix debugfs-less systems support
    UBI: fix debugfs-less systems support

    Linus Torvalds
     
  • This reverts commit 7732a557b1342c6e6966efb5f07effcf99f56167 (and commit
    3f50fff4dace23d3cfeb195d5cd4ee813cee68b7, which was a follow-up
    cleanup).

    We're chasing an elusive bug that Dave Jones can apparently reproduce
    using his system call fuzzer tool, and that looks like some kind of
    locking ordering problem on the directory i_mutex chain. Our i_mutex
    locking is rather complex, and depends on the topological ordering of
    the directories, which is why we have been very wary of splicing
    directory entries around.

    Of course, we really don't want to ever see aliased unconnected
    directories anyway, so none of this should ever happen, but this revert
    aims to basically get us back to a known older state.

    Bruce points to some of the previous discussion at

    http://marc.info/?i=

    and in particular a long post from Neil:

    http://marc.info/?i=

    It should be noted that it's possible that Dave's problems come from
    other changes altohgether, including possibly just the fact that Dave
    constantly is teachning his fuzzer new tricks. So what appears to be a
    new bug could in fact be an old one that just gets newly triggered, but
    reverting these patches as "still under heavy discussion" is the right
    thing regardless.

    Requested-by: Al Viro
    Acked-by: J. Bruce Fields
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Pull x86 fixes from Ingo Molnar.

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/nmi: Fix section mismatch warnings on 32-bit
    x86/uv: Fix UV2 BAU legacy mode
    x86/mm: Only add extra pages count for the first memory range during pre-allocation early page table space
    x86, efi stub: Add .reloc section back into image
    x86/ioapic: Fix NULL pointer dereference on CPU hotplug after disabling irqs
    x86/reboot: Fix a warning message triggered by stop_other_cpus()
    x86/intel/moorestown: Change intel_scu_devices_create() to __devinit
    x86/numa: Set numa_nodes_parsed at acpi_numa_memory_affinity_init()
    x86/gart: Fix kmemleak warning
    x86: mce: Add the dropped timer interval init back
    x86/mce: Fix the MCE poll timer logic

    Linus Torvalds
     
  • Pull perf fixes from Ingo Molnar:
    "A bit larger than what I'd wish for - half of it is due to hw driver
    updates to Intel Ivy-Bridge which info got recently released,
    cycles:pp should work there now too, amongst other things. (but we
    are generally making exceptions for hardware enablement of this type.)

    There are also callchain fixes in it - responding to mostly
    theoretical (but valid) concerns. The tooling side sports perf.data
    endianness/portability fixes which did not make it for the merge
    window - and various other fixes as well."

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits)
    perf/x86: Check user address explicitly in copy_from_user_nmi()
    perf/x86: Check if user fp is valid
    perf: Limit callchains to 127
    perf/x86: Allow multiple stacks
    perf/x86: Update SNB PEBS constraints
    perf/x86: Enable/Add IvyBridge hardware support
    perf/x86: Implement cycles:p for SNB/IVB
    perf/x86: Fix Intel shared extra MSR allocation
    x86/decoder: Fix bsr/bsf/jmpe decoding with operand-size prefix
    perf: Remove duplicate invocation on perf_event_for_each
    perf uprobes: Remove unnecessary check before strlist__delete
    perf symbols: Check for valid dso before creating map
    perf evsel: Fix 32 bit values endianity swap for sample_id_all header
    perf session: Handle endianity swap on sample_id_all header data
    perf symbols: Handle different endians properly during symbol load
    perf evlist: Pass third argument to ioctl explicitly
    perf tools: Update ioctl documentation for PERF_IOC_FLAG_GROUP
    perf tools: Make --version show kernel version instead of pull req tag
    perf tools: Check if callchain is corrupted
    perf callchain: Make callchain cursors TLS
    ...

    Linus Torvalds
     
  • Pull drm intel and exynos fixes from Dave Airlie:
    "A bunch of fixes for Intel and exynos, nothing too major, a new intel
    PCI ID, and a fix for CRT detection."

    * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    drm/i915: pch_irq_handler -> {ibx, cpt}_irq_handler
    char/agp: add another Ironlake host bridge
    drm/i915: fix up ivb plane 3 pageflips
    drm/exynos: fixed blending for hdmi graphic layer
    drm/exynos: Remove dummy encoder get_crtc operation implementation
    drm/exynos: Keep a reference to frame buffer GEM objects
    drm/exynos: Don't cast GEM object to Exynos GEM object when not needed
    drm/exynos: DRIVER_BUS_PLATFORM is not a driver feature
    drm/exynos: fixed size type.
    drm/exynos: Use DRM_FORMAT_{NV12, YUV420} instead of DRM_FORMAT_{NV12M, YUV420M}
    drm/i915: hold forcewake around ring hw init
    drm/i915: Mark the ringbuffers as being in the GTT domain
    drm/i915/crt: Do not rely upon the HPD presence pin
    drm/i915: Reset last_retired_head when resetting ring

    Linus Torvalds
     
  • Pull leap second timer fix from Thomas Gleixner.

    * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond

    Linus Torvalds
     
  • …it/rusty/linux-2.6-for-linus

    Pull minor module param fixes from Rusty Russell:
    "One bugfix for multiple moduleparam levels, one removal of overzealous
    printk."

    * tag 'moduleparam-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
    init: Drop initcall level output
    module_param: stop double-calling parameters.

    Linus Torvalds
     

08 Jun, 2012

12 commits

  • It was reported that compiling for 32-bit caused a bunch of
    section mismatch warnings:

    VDSOSYM arch/x86/vdso/vdso32-syms.lds
    LD arch/x86/vdso/built-in.o
    LD arch/x86/built-in.o

    WARNING: arch/x86/built-in.o(.data+0x5af0): Section mismatch in
    reference from the variable test_nmi_ipi_callback_na.10451 to
    the function .init.text:test_nmi_ipi_callback() [...]

    WARNING: arch/x86/built-in.o(.data+0x5b04): Section mismatch in
    reference from the variable nmi_unk_cb_na.10399 to the function
    .init.text:nmi_unk_cb() The variable nmi_unk_cb_na.10399
    references the function __init nmi_unk_cb() [...]

    Both of these are attributed to the internal representation of
    the nmiaction struct created during register_nmi_handler. The
    reason for this is that those structs are not defined in the
    init section whereas the rest of the code in nmi_selftest.c is.

    To resolve this, I created a new #define,
    register_nmi_handler_initonly, that tags the struct as
    __initdata to resolve the mismatch. This #define should only be
    used in rare situations where the register/unregister is called
    during init of the kernel.

    Big thanks to Jan Beulich for decoding this for me as I didn't
    have a clue what was going on.

    Reported-by: Witold Baryluk
    Tested-by: Witold Baryluk
    Cc: Jan Beulich
    Signed-off-by: Don Zickus
    Link: http://lkml.kernel.org/r/1338991542-23000-1-git-send-email-dzickus@redhat.com
    Signed-off-by: Ingo Molnar

    Don Zickus
     
  • This fixes a problem which can causes kernel oopses while loading
    a kernel module.

    According to the PowerPC EABI specification, GPR r11 is assigned
    the dedicated function to point to the previous stack frame.
    In the powerpc-specific kernel module loader, do_plt_call()
    (in arch/powerpc/kernel/module_32.c), GPR r11 is also used
    to generate trampoline code.

    This combination crashes the kernel, in the case where the compiler
    chooses to use a helper function for saving GPRs on entry, and the
    module loader has placed the .init.text section far away from the
    .text section, meaning that it has to generate a trampoline for
    functions in the .init.text section to call the GPR save helper.
    Because the trampoline trashes r11, references to the stack frame
    using r11 can cause an oops.

    The fix just uses GPR r12 instead of GPR r11 for generating the
    trampoline code. According to the statements from Freescale, this is
    safe from an EABI perspective.

    I've tested the fix for kernel 2.6.33 on MPC8541.

    Cc: stable@vger.kernel.org
    Signed-off-by: Steffen Rumler
    [paulus@samba.org: reworded the description]
    Signed-off-by: Paul Mackerras

    Steffen Rumler
     
  • The SGI Altix UV2 BAU (Broadcast Assist Unit) as used for
    tlb-shootdown (selective broadcast mode) always uses UV2
    broadcast descriptor format. There is no need to clear the
    'legacy' (UV1) mode, because the hardware always uses UV2 mode
    for selective broadcast.

    But the BIOS uses general broadcast and legacy mode, and the
    hardware pays attention to the legacy mode bit for general
    broadcast. So the kernel must not clear that mode bit.

    Signed-off-by: Cliff Wickman
    Cc:
    Link: http://lkml.kernel.org/r/E1SccoO-0002Lh-Cb@eag09.americas.sgi.com
    Signed-off-by: Ingo Molnar

    Cliff Wickman
     
  • …ion early page table space

    Robin found this regression:

    | I just tried to boot an 8TB system. It fails very early in boot with:
    | Kernel panic - not syncing: Cannot find space for the kernel page tables

    git bisect commit 722bc6b16771ed80871e1fd81c86d3627dda2ac8.

    A git revert of that commit does boot past that point on the 8TB
    configuration.

    That commit will add up extra pages for all memory range even
    above 4g.

    Try to limit that extra page count adding to first entry only.

    Bisected-by: Robin Holt <holt@sgi.com>
    Tested-by: Robin Holt <holt@sgi.com>
    Signed-off-by: Yinghai Lu <yinghai@kernel.org>
    Cc: WANG Cong <xiyou.wangcong@gmail.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/CAE9FiQUj3wyzQxtq9yzBNc9u220p8JZ1FYHG7t%3DMOzJ%3D9BZMYA@mail.gmail.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Yinghai Lu
     
  • * 'exynos-drm-fixes' of git://git.infradead.org/users/kmpark/linux-samsung:
    drm/exynos: fixed blending for hdmi graphic layer
    drm/exynos: Remove dummy encoder get_crtc operation implementation
    drm/exynos: Keep a reference to frame buffer GEM objects
    drm/exynos: Don't cast GEM object to Exynos GEM object when not needed
    drm/exynos: DRIVER_BUS_PLATFORM is not a driver feature
    drm/exynos: fixed size type.
    drm/exynos: Use DRM_FORMAT_{NV12, YUV420} instead of DRM_FORMAT_{NV12M, YUV420M}

    Dave Airlie
     
  • * 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel:
    drm/i915: pch_irq_handler -> {ibx, cpt}_irq_handler
    char/agp: add another Ironlake host bridge
    drm/i915: fix up ivb plane 3 pageflips
    drm/i915: hold forcewake around ring hw init
    drm/i915: Mark the ringbuffers as being in the GTT domain
    drm/i915/crt: Do not rely upon the HPD presence pin
    drm/i915: Reset last_retired_head when resetting ring

    Dave Airlie
     
  • 9fb48c744ba6a ("params: add 3rd arg to option handler callback
    signature") added similar lines to dmesg:

    initlevel:0=early, 4 registered initcalls
    initlevel:1=core, 31 registered initcalls
    initlevel:2=postcore, 11 registered initcalls
    initlevel:3=arch, 7 registered initcalls
    initlevel:4=subsys, 40 registered initcalls
    initlevel:5=fs, 30 registered initcalls
    initlevel:6=device, 250 registered initcalls
    initlevel:7=late, 35 registered initcalls

    but they don't contain any info for the general user staring at dmesg.
    I'm very doubtful the count of initcalls registered per level helps
    anyone so drop that output completely.

    Cc: Jim Cromie
    Cc: Rusty Russell
    Cc: Jason Baron
    Signed-off-by: Borislav Petkov
    Signed-off-by: Rusty Russell

    Borislav Petkov
     
  • Commit 026cee0086fe1df4cf74691cf273062cc769617d "params:
    _initcall-like kernel parameters" set old-style module
    parameters to level 0. And we call those level 0 calls where we used
    to, early in start_kernel().

    We also loop through the initcall levels and call the levelled
    module_params before the corresponding initcall. Unfortunately level
    0 is early_init(), so we call the standard module_param calls twice.

    (Turns out most things don't care, but at least ubi.mtd does).

    Change the level to -1 for standard module_param calls.

    Reported-by: Benoît Thébaudeau
    Signed-off-by: Rusty Russell
    Cc: stable@kernel.org

    Rusty Russell
     
  • This reverts 68568add2c ("powerpc/time: Remove unnecessary sanity check
    of decrementer expiration"). We do need to check whether we have reached
    the expiration time of the next event, because we sometimes get an early
    decrementer interrupt, most notably when we set the decrementer to 1 in
    arch_irq_work_raise(). The effect of not having the sanity check is that
    if timer_interrupt() gets called early, we leave the decrementer set to
    its maximum value, which means we then don't get any more decrementer
    interrupts for about 4 seconds (or longer, depending on timebase
    frequency). I saw these pauses as a consequence of getting a stray
    hypervisor decrementer interrupt left over from exiting a KVM guest.

    This isn't quite a straight revert because of changes to the surrounding
    code, but it restores the same algorithm as was previously used.

    Cc: stable@vger.kernel.org
    Acked-by: Anton Blanchard
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • This reverts commit 40af1bbdca47e5c8a2044039bb78ca8fd8b20f94.

    It's horribly and utterly broken for at least the following reasons:

    - calling sync_mm_rss() from mmput() is fundamentally wrong, because
    there's absolutely no reason to believe that the task that does the
    mmput() always does it on its own VM. Example: fork, ptrace, /proc -
    you name it.

    - calling it *after* having done mmdrop() on it is doubly insane, since
    the mm struct may well be gone now.

    - testing mm against NULL before you call it is insane too, since a
    NULL mm there would have caused oopses long before.

    .. and those are just the three bugs I found before I decided to give up
    looking for me and revert it asap. I should have caught it before I
    even took it, but I trusted Andrew too much.

    Cc: Konstantin Khlebnikov
    Cc: Markus Trippelsdorf
    Cc: Hugh Dickins
    Cc: KAMEZAWA Hiroyuki
    Cc: Oleg Nesterov
    Cc: Andrew Morton
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Commit 7990696 uses the ext4_{set,clear}_inode_flags() functions to
    change the i_flags automatically but fails to remove the error setting
    of i_flags. So we still have the problem of trashing state flags.
    Fix this by removing the assignment.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"
    Cc: stable@kernel.org

    Tao Ma
     
  • Ext3 filesystems that are converted to use as many ext4 file system
    features as possible will enable uninit_bg to speed up e2fsck times.
    These file systems will have a native ext3 layout of inode tables and
    block allocation bitmaps (as opposed to ext4's flex_bg layout).
    Unfortunately, in these cases, when first allocating a block in an
    uninitialized block group, ext4 would incorrectly calculate the number
    of free blocks in that block group, and then errorneously report that
    the file system was corrupt:

    EXT4-fs error (device vdd): ext4_mb_generate_buddy:741: group 30, 32254 clusters in bitmap, 32258 in gd

    This problem can be reproduced via:

    mke2fs -q -t ext4 -O ^flex_bg /dev/vdd 5g
    mount -t ext4 /dev/vdd /mnt
    fallocate -l 4600m /mnt/test

    The problem was caused by a bone headed mistake in the check to see if a
    particular metadata block was part of the block group.

    Many thanks to Kees Cook for finding and bisecting the buggy commit
    which introduced this bug (commit fd034a84e1, present since v3.2).

    Reported-by: Sander Eikelenboom
    Reported-by: Kees Cook
    Signed-off-by: "Theodore Ts'o"
    Tested-by: Kees Cook
    Cc: stable@kernel.org

    Theodore Ts'o