01 Dec, 2018

4 commits

  • CONFIG_DEBUG_OBJECTS_RCU_HEAD does not play well with kmemleak due to
    recursive calls.

    fill_pool
    kmemleak_ignore
    make_black_object
    put_object
    __call_rcu (kernel/rcu/tree.c)
    debug_rcu_head_queue
    debug_object_activate
    debug_object_init
    fill_pool
    kmemleak_ignore
    make_black_object
    ...

    So add SLAB_NOLEAKTRACE to kmem_cache_create() to not register newly
    allocated debug objects at all.

    Link: http://lkml.kernel.org/r/20181126165343.2339-1-cai@gmx.us
    Signed-off-by: Qian Cai
    Suggested-by: Catalin Marinas
    Acked-by: Waiman Long
    Acked-by: Catalin Marinas
    Cc: Thomas Gleixner
    Cc: Yang Shi
    Cc: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Qian Cai
     
  • We free the misc device string twice on rmmod; fix this. Without this
    we cannot remove the module without crashing.

    Link: http://lkml.kernel.org/r/20181124050500.5257-1-mcgrof@kernel.org
    Signed-off-by: Luis Chamberlain
    Reported-by: Randy Dunlap
    Reviewed-by: Andrew Morton
    Cc: [4.12+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Luis Chamberlain
     
  • New versions of gcc reasonably warn about the odd pattern of

    strncpy(p, q, strlen(q));

    which really doesn't make sense: the strncpy() ends up being just a slow
    and odd way to write memcpy() in this case.

    Apparently there was a patch for this floating around earlier, but it
    got lost.

    Acked-again-by: Andy Shevchenko
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Pull vfs fixes from Al Viro:
    "Assorted fixes all over the place.

    The iov_iter one is this cycle regression (splice from UDP triggering
    WARN_ON()), the rest is older"

    * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    afs: Use d_instantiate() rather than d_add() and don't d_drop()
    afs: Fix missing net error handling
    afs: Fix validation/callback interaction
    iov_iter: teach csum_and_copy_to_iter() to handle pipe-backed ones
    exportfs: do not read dentry after free
    exportfs: fix 'passing zero to ERR_PTR()' warning
    aio: fix failure to put the file pointer
    sysv: return 'err' instead of 0 in __sysv_write_inode

    Linus Torvalds
     

26 Nov, 2018

1 commit


25 Nov, 2018

1 commit

  • Pull XArray updates from Matthew Wilcox:
    "We found some bugs in the DAX conversion to XArray (and one bug which
    predated the XArray conversion). There were a couple of bugs in some
    of the higher-level functions, which aren't actually being called in
    today's kernel, but surfaced as a result of converting existing radix
    tree & IDR users over to the XArray.

    Some of the other changes to how the higher-level APIs work were also
    motivated by converting various users; again, they're not in use in
    today's kernel, so changing them has a low probability of introducing
    a bug.

    Dan can still trigger a bug in the DAX code with hot-offline/online,
    and we're working on tracking that down"

    * tag 'xarray-4.20-rc4' of git://git.infradead.org/users/willy/linux-dax:
    XArray tests: Add missing locking
    dax: Avoid losing wakeup in dax_lock_mapping_entry
    dax: Fix huge page faults
    dax: Fix dax_unlock_mapping_entry for PMD pages
    dax: Reinstate RCU protection of inode
    dax: Make sure the unlocking entry isn't locked
    dax: Remove optimisation from dax_lock_mapping_entry
    XArray tests: Correct some 64-bit assumptions
    XArray: Correct xa_store_range
    XArray: Fix Documentation
    XArray: Handle NULL pointers differently for allocation
    XArray: Unify xa_store and __xa_store
    XArray: Add xa_store_bh() and xa_store_irq()
    XArray: Turn xa_erase into an exported function
    XArray: Unify xa_cmpxchg and __xa_cmpxchg
    XArray: Regularise xa_reserve
    nilfs2: Use xa_erase_irq
    XArray: Export __xa_foo to non-GPL modules
    XArray: Fix xa_for_each with a single element at 0

    Linus Torvalds
     

23 Nov, 2018

1 commit

  • Pull char/misc driver fixes from Greg KH:
    "Here are some small char/misc driver fixes for issues that have been
    reported.

    Nothing major, highlights include:

    - gnss sync write fixes

    - uio oops fix

    - nvmem fixes

    - other minor fixes and some documentation/maintainers updates

    Full details are in the shortlog.

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'char-misc-4.20-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
    Documentation/security-bugs: Postpone fix publication in exceptional cases
    MAINTAINERS: Add Sasha as a stable branch maintainer
    gnss: sirf: fix synchronous write timeout
    gnss: serial: fix synchronous write timeout
    uio: Fix an Oops on load
    test_firmware: fix error return getting clobbered
    nvmem: core: fix regression in of_nvmem_cell_get()
    misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
    drivers/misc/sgi-gru: fix Spectre v1 vulnerability
    Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up
    slimbus: ngd: remove unnecessary check

    Linus Torvalds
     

19 Nov, 2018

2 commits

  • Lockdep caught me being sloppy in the test suite and failing to lock
    the XArray appropriately.

    Reported-by: kernel test robot
    Signed-off-by: Matthew Wilcox

    Matthew Wilcox
     
  • gcc-8 complains about the prototype for this function:

    lib/ubsan.c:432:1: error: ignoring attribute 'noreturn' in declaration of a built-in function '__ubsan_handle_builtin_unreachable' because it conflicts with attribute 'const' [-Werror=attributes]

    This is actually a GCC's bug. In GCC internals
    __ubsan_handle_builtin_unreachable() declared with both 'noreturn' and
    'const' attributes instead of only 'noreturn':

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84210

    Workaround this by removing the noreturn attribute.

    [aryabinin: add information about GCC bug in changelog]
    Link: http://lkml.kernel.org/r/20181107144516.4587-1-aryabinin@virtuozzo.com
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Andrey Ryabinin
    Acked-by: Olof Johansson
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     

17 Nov, 2018

2 commits


15 Nov, 2018

1 commit


12 Nov, 2018

1 commit

  • In the case where eq->fw->size > PAGE_SIZE the error return rc
    is being set to EINVAL however this is being overwritten to
    rc = req->fw->size because the error exit path via label 'out' is
    not being taken. Fix this by adding the jump to the error exit
    path 'out'.

    Detected by CoverityScan, CID#1453465 ("Unused value")

    Fixes: c92316bf8e94 ("test_firmware: add batched firmware tests")
    Signed-off-by: Colin Ian King
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     

07 Nov, 2018

1 commit

  • The lib/raid6/test fails to build the neon objects
    on arm64 because the correct machine type is 'aarch64'.

    Once this is correctly enabled, the neon recovery objects
    need to be added to the build.

    Reviewed-by: Ard Biesheuvel
    Signed-off-by: Jeremy Linton
    Signed-off-by: Catalin Marinas

    Jeremy Linton
     

06 Nov, 2018

8 commits


02 Nov, 2018

1 commit

  • Pull AFS updates from Al Viro:
    "AFS series, with some iov_iter bits included"

    * 'work.afs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
    missing bits of "iov_iter: Separate type from direction and use accessor functions"
    afs: Probe multiple fileservers simultaneously
    afs: Fix callback handling
    afs: Eliminate the address pointer from the address list cursor
    afs: Allow dumping of server cursor on operation failure
    afs: Implement YFS support in the fs client
    afs: Expand data structure fields to support YFS
    afs: Get the target vnode in afs_rmdir() and get a callback on it
    afs: Calc callback expiry in op reply delivery
    afs: Fix FS.FetchStatus delivery from updating wrong vnode
    afs: Implement the YFS cache manager service
    afs: Remove callback details from afs_callback_break struct
    afs: Commit the status on a new file/dir/symlink
    afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS
    afs: Don't invoke the server to read data beyond EOF
    afs: Add a couple of tracepoints to log I/O errors
    afs: Handle EIO from delivery function
    afs: Fix TTL on VL server and address lists
    afs: Implement VL server rotation
    afs: Improve FS server rotation error handling
    ...

    Linus Torvalds
     

01 Nov, 2018

2 commits

  • …l/git/palmer/riscv-linux

    Pull more RISC-V updates from Palmer Dabbelt:
    "This contains the follow-on patches I'd like to target for the 4.20
    merge window. I'm being somewhat conservative here, as while there are
    a few patches on the mailing list that were posted early in the merge
    window I'd like to let those bake for another round -- this was a
    fairly big release as far as RISC-V is concerened, and we need to walk
    before we can run.

    As far as the patches that made it go:

    - A patch to ignore offline CPUs when calculating AT_HWCAP. This
    should fix GDB on the HiFive unleashed, which has an embedded core
    for hart 0 which is exposed to Linux as an offline CPU.

    - A move of EM_RISCV to elf-em.h, which is where it should have been
    to begin with.

    - I've also removed the 64-bit divide routines. I know I'm not really
    playing by my own rules here because I posted the patches this
    morning, but since they shouldn't be in the kernel I think it's
    better to err on the side of going too fast here.

    I don't anticipate any more patch sets for the merge window"

    * tag 'riscv-for-linus-4.20-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux:
    Move EM_RISCV into elf-em.h
    RISC-V: properly determine hardware caps
    Revert "lib: Add umoddi3 and udivmoddi4 of GCC library routines"
    Revert "RISC-V: Select GENERIC_LIB_UMODDI3 on RV32"

    Linus Torvalds
     
  • We don't want 64-bit divide in the kernel.

    This reverts commit 6315730e9eab7de5fa9864bb13a352713f48aef1.

    Signed-off-by: Palmer Dabbelt

    Palmer Dabbelt
     

31 Oct, 2018

14 commits

  • When a memblock allocation APIs are called with align = 0, the alignment
    is implicitly set to SMP_CACHE_BYTES.

    Implicit alignment is done deep in the memblock allocator and it can
    come as a surprise. Not that such an alignment would be wrong even
    when used incorrectly but it is better to be explicit for the sake of
    clarity and the prinicple of the least surprise.

    Replace all such uses of memblock APIs with the 'align' parameter
    explicitly set to SMP_CACHE_BYTES and stop implicit alignment assignment
    in the memblock internal allocation functions.

    For the case when memblock APIs are used via helper functions, e.g. like
    iommu_arena_new_node() in Alpha, the helper functions were detected with
    Coccinelle's help and then manually examined and updated where
    appropriate.

    The direct memblock APIs users were updated using the semantic patch below:

    @@
    expression size, min_addr, max_addr, nid;
    @@
    (
    |
    - memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
    + memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,
    nid)
    |
    - memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
    + memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,
    nid)
    |
    - memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
    + memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
    |
    - memblock_alloc(size, 0)
    + memblock_alloc(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_raw(size, 0)
    + memblock_alloc_raw(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_from(size, 0, min_addr)
    + memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
    |
    - memblock_alloc_nopanic(size, 0)
    + memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_low(size, 0)
    + memblock_alloc_low(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_low_nopanic(size, 0)
    + memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_from_nopanic(size, 0, min_addr)
    + memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
    |
    - memblock_alloc_node(size, 0, nid)
    + memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
    )

    [mhocko@suse.com: changelog update]
    [akpm@linux-foundation.org: coding-style fixes]
    [rppt@linux.ibm.com: fix missed uses of implicit alignment]
    Link: http://lkml.kernel.org/r/20181016133656.GA10925@rapoport-lnx
    Link: http://lkml.kernel.org/r/1538687224-17535-1-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Suggested-by: Michal Hocko
    Acked-by: Paul Burton [MIPS]
    Acked-by: Michael Ellerman [powerpc]
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: Geert Uytterhoeven
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: Matt Turner
    Cc: Michal Simek
    Cc: Richard Weinberger
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Move remaining definitions and declarations from include/linux/bootmem.h
    into include/linux/memblock.h and remove the redundant header.

    The includes were replaced with the semantic patch below and then
    semi-automated removal of duplicated '#include

    @@
    @@
    - #include
    + #include

    [sfr@canb.auug.org.au: dma-direct: fix up for the removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181002185342.133d1680@canb.auug.org.au
    [sfr@canb.auug.org.au: powerpc: fix up for removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181005161406.73ef8727@canb.auug.org.au
    [sfr@canb.auug.org.au: x86/kaslr, ACPI/NUMA: fix for linux/bootmem.h removal]
    Link: http://lkml.kernel.org/r/20181008190341.5e396491@canb.auug.org.au
    Link: http://lkml.kernel.org/r/1536927045-23536-30-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Stephen Rothwell
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The conversion is done using

    sed -i 's@memblock_virt_alloc@memblock_alloc@g' \
    $(git grep -l memblock_virt_alloc)

    Link: http://lkml.kernel.org/r/1536927045-23536-8-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Hocko
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • All architecures use memblock for early memory management. There is no need
    for the CONFIG_HAVE_MEMBLOCK configuration option.

    [rppt@linux.vnet.ibm.com: of/fdt: fixup #ifdefs]
    Link: http://lkml.kernel.org/r/20180919103457.GA20545@rapoport-lnx
    [rppt@linux.vnet.ibm.com: csky: fixups after bootmem removal]
    Link: http://lkml.kernel.org/r/20180926112744.GC4628@rapoport-lnx
    [rppt@linux.vnet.ibm.com: remove stale #else and the code it protects]
    Link: http://lkml.kernel.org/r/1538067825-24835-1-git-send-email-rppt@linux.vnet.ibm.com
    Link: http://lkml.kernel.org/r/1536927045-23536-4-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Michal Hocko
    Tested-by: Jonathan Cameron
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Update the LZ4 compression module based on LZ4 v1.8.3 in order for the
    erofs file system to use the newest LZ4_decompress_safe_partial() which
    can now decode exactly the nb of bytes requested [1] to take place of the
    open hacked code in the erofs file system itself.

    Currently, apart from the erofs file system, no other users use
    LZ4_decompress_safe_partial, so no worry about the interface.

    In addition, LZ4 v1.8.x boosts up decompression speed compared to the
    current code which is based on LZ4 v1.7.3, mainly due to shortcut
    optimization for the specific common LZ4-sequences [2].

    lzbench testdata (tested in kirin710, 8 cores, 4 big cores
    at 2189Mhz, 2GB DDR RAM at 1622Mhz, with enwik8 testdata [3]):

    Compressor name Compress. Decompress. Compr. size Ratio Filename
    memcpy 5004 MB/s 4924 MB/s 100000000 100.00 enwik8
    lz4hc 1.7.3 -9 12 MB/s 653 MB/s 42203253 42.20 enwik8
    lz4hc 1.8.0 -9 12 MB/s 908 MB/s 42203096 42.20 enwik8
    lz4hc 1.8.3 -9 11 MB/s 965 MB/s 42203094 42.20 enwik8

    [1] https://github.com/lz4/lz4/issues/566
    https://github.com/lz4/lz4/commit/08d347b5b217b011ff7487130b79480d8cfdaeb8

    [2] v1.8.1 perf: slightly faster compression and decompression speed
    https://github.com/lz4/lz4/commit/a31b7058cb97e4393da55e78a77a1c6f0c9ae038
    v1.8.2 perf: slightly faster HC compression and decompression speed
    https://github.com/lz4/lz4/commit/45f8603aae389d34c689d3ff7427b314071ccd2c
    https://github.com/lz4/lz4/commit/1a191b3f8d26b50a7c1d41590b529ec308d768cd

    [3] http://mattmahoney.net/dc/textdata.html
    http://mattmahoney.net/dc/enwik8.zip

    Link: http://lkml.kernel.org/r/1537181207-21932-1-git-send-email-gaoxiang25@huawei.com
    Signed-off-by: Gao Xiang
    Tested-by: Guo Xuenan
    Cc: Colin Ian King
    Cc: Yann Collet
    Cc: Greg Kroah-Hartman
    Cc: Fang Wei
    Cc: Chao Yu
    Cc: Miao Xie
    Cc: Sven Schmidt
    Cc: Kyungsik Lee
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gao Xiang
     
  • Implicit casts to the same type are done by the language if necessary.

    Link: http://lkml.kernel.org/r/20181014223934.GA18107@avx2
    Signed-off-by: Alexey Dobriyan
    Reviewed-by: Andrew Morton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • mempool_destroy(NULL) and kmem_cache_destroy(NULL) are legal

    Link: http://lkml.kernel.org/r/1533054107-35657-1-git-send-email-zhongjiang@huawei.com
    Signed-off-by: zhong jiang
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    zhong jiang
     
  • This patch remove all following fall through warnings by
    adding /* fall through */ markers.
    Note that we cannot add "__attribute__ ((fallthrough));" due to it is GCC7 only
    arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:384:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
    arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:391:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
    arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:393:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
    arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:430:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
    arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:556:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
    arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:595:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
    arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:602:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
    arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:627:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
    arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:646:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
    arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:696:25: warning: this statement may fall through [-Wimplicit-fallthrough=]

    It is easy to see that thoses fall through are needed since in each case state->mode are set to the case value just below.

    Link: http://lkml.kernel.org/r/1536215920-19955-1-git-send-email-clabbe@baylibre.com
    Signed-off-by: Corentin Labbe
    Cc: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Corentin Labbe
     
  • This simplifies the code. No change in behavior.

    Link: http://lkml.kernel.org/r/20180830194727.191555-1-ebiggers@kernel.org
    Signed-off-by: Eric Biggers
    Reviewed-by: Andrew Morton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Biggers
     
  • This simplifies the code. No change in behavior.

    Link: http://lkml.kernel.org/r/20180830194814.192880-1-ebiggers@kernel.org
    Signed-off-by: Eric Biggers
    Reviewed-by: Andrew Morton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Biggers
     
  • This simplifies the code. No change in behavior.

    Link: http://lkml.kernel.org/r/20180830194436.188867-1-ebiggers@kernel.org
    Signed-off-by: Eric Biggers
    Reviewed-by: Andrew Morton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Biggers
     
  • len is guaranteed to lie in [1, PAGE_SIZE]. If scnprintf is called with a
    buffer size of 1, it is guaranteed to return 0. So in the extremely
    unlikely case of having just one byte remaining in the page, let's just
    call scnprintf anyway. The only difference is that this will write a '\0'
    to that final byte in the page, but that's an improvement: We now
    guarantee that after the call, buf is a properly terminated C string of
    length exactly the return value.

    Link: http://lkml.kernel.org/r/20180818131623.8755-8-linux@rasmusvillemoes.dk
    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Andy Shevchenko
    Cc: Yury Norov
    Cc: Rasmus Villemoes
    Cc: Sudeep Holla
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • For various alignments of buf, the current expression computes

    4096 ok
    4095 ok
    8190
    8189
    ...
    4097

    i.e., if the caller has already written two bytes into the page buffer,
    len is 8190 rather than 4094, because PTR_ALIGN aligns up to the next
    boundary. So if the printed version of the bitmap is huge, scnprintf()
    ends up writing beyond the page boundary.

    I don't think any current callers actually write anything before
    bitmap_print_to_pagebuf, but the API seems to be designed to allow it.

    [akpm@linux-foundation.org: use offset_in_page(), per Andy]
    [akpm@linux-foundation.org: include mm.h for offset_in_page()]
    Link: http://lkml.kernel.org/r/20180818131623.8755-7-linux@rasmusvillemoes.dk
    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Andy Shevchenko
    Cc: Yury Norov
    Cc: Rasmus Villemoes
    Cc: Sudeep Holla
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • This promise is violated in a number of places, e.g. already in the
    second function below this paragraph. Since I don't think anybody relies
    on this being true, and since actually honouring it would hurt performance
    and code size in various places, just remove the paragraph.

    Link: http://lkml.kernel.org/r/20180818131623.8755-2-linux@rasmusvillemoes.dk
    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Andy Shevchenko
    Cc: Yury Norov
    Cc: Rasmus Villemoes
    Cc: Sudeep Holla
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     

29 Oct, 2018

1 commit

  • Pull VLA removal from Kees Cook:
    "Globally warn on VLA use.

    This turns on "-Wvla" globally now that the last few trees with their
    VLA removals have landed (crypto, block, net, and powerpc).

    Arnd mentioned that there may be a couple more VLAs hiding in
    hard-to-find randconfigs, but nothing big has shaken out in the last
    month or so in linux-next.

    We should be basically VLA-free now! Wheee. :)

    Summary:

    - Remove unused fallback for BUILD_BUG_ON (which technically contains
    a VLA)

    - Lift -Wvla to the top-level Makefile"

    * tag 'vla-v4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    Makefile: Globally enable VLA warning
    compiler.h: give up __compiletime_assert_fallback()

    Linus Torvalds