374 Commits

Author SHA1 Message Date
kondors1995
6abb77db34 Import EROFS from 80301c31dc
Squashed commit of the following:

commit 37695a77521cfccbf92840cc13dcc4d8cb7dda96
Author: pwnrazr <1644943+pwnrazr@users.noreply.github.com>
Date:   Thu Feb 16 00:00:20 2023 +0800

    raphael_defconfig: enable erofs highpri percpu kthread

commit 816e4801de2002f5f53e7cd2f7aea282755d5391
Author: John Galt <johngaltfirstrun@gmail.com>
Date:   Mon Mar 6 15:48:21 2023 -0500

    fs/(erofs || f2fs): drop WQ_UNBOUND

    Due to asym arm64 latency regression on WQ_UNBOUND

commit d0e5cb53f102962d0d40ff12f548542d71f6340e
Author: John Galt <johngaltfirstrun@gmail.com>
Date:   Wed Feb 15 10:44:37 2023 -0500

    erofs/zdata: modify set sched to use RR at high prio for lower latency

    Fixes: bdd668d3b54202

commit afc1c08015966909a27c9d3d53d8796e80c3e4ef
Author: Sandeep Dhavale <dhavale@google.com>
Date:   Wed Feb 8 06:53:49 2023 +0000

    [WIP] BACKPORT: FROMLIST: erofs: add per-cpu threads for decompression

    Using per-cpu thread pool we can reduce the scheduling latency compared
    to workqueue implementation. With this patch scheduling latency and
    variation is reduced as per-cpu threads are high priority kthread_workers.

    The results were evaluated on arm64 Android devices running 5.10 kernel.

    The table below shows resulting improvements of total scheduling latency
    for the same app launch benchmark runs with 50 iterations. Scheduling
    latency is the latency between when the task (workqueue kworker vs
    kthread_worker) became eligible to run to when it actually started
    running.
    +-------------------------+-----------+----------------+---------+
    |                         | workqueue | kthread_worker |  diff   |
    +-------------------------+-----------+----------------+---------+
    | Average (us)            |     15253 |           2914 | -80.89% |
    | Median (us)             |     14001 |           2912 | -79.20% |
    | Minimum (us)            |      3117 |           1027 | -67.05% |
    | Maximum (us)            |     30170 |           3805 | -87.39% |
    | Standard deviation (us) |      7166 |            359 |         |
    +-------------------------+-----------+----------------+---------+

    Background: Boot times and cold app launch benchmarks are very
    important to the android ecosystem as they directly translate to
    responsiveness from user point of view. While erofs provides
    a lot of important features like space savings, we saw some
    performance penalty in cold app launch benchmarks in few scenarios.
    Analysis showed that the significant variance was coming from the
    scheduling cost while decompression cost was more or less the same.

    Having per-cpu thread pool we can see from the above table that this
    variation is reduced by ~80% on average. This problem was discussed
    at LPC 2022. Link to LPC 2022 slides and
    talk at [1]

    [1] https://lpc.events/event/16/contributions/1338/

    Link: https://lore.kernel.org/lkml/Y+DP6V9fZG7XPPGy@debian/

    Change-Id: I454da5bc17f285d99047b93dc1fc70444f287156
    Signed-off-by: Sandeep Dhavale <dhavale@google.com>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 354d97368e8ffd832a43f6aa0d7c43f52268ca80
Author: pwnrazr <1644943+pwnrazr@users.noreply.github.com>
Date:   Sat May 7 13:21:24 2022 +0800

    sm8150: dtsi: remove barrier and discard mount options

commit 6c0b4a711ecb5b0e30c6115959b48af641e9b5bf
Author: pwnrazr <1644943+pwnrazr@users.noreply.github.com>
Date:   Sat May 7 13:20:47 2022 +0800

    Revert "arch: arm64: disable erofs"

    This reverts commit fe6fe5ef6107fc245ca50cd38f585e580fe2fc59.

commit 515b1441ad6ac0f9e1c74013cd80e9b30065edc0
Author: kondors1995 <normandija1945@gmail.com>
Date:   Wed Feb 8 16:43:29 2023 +0200

    Revert "raphael_defconfig: Revert FBEv2 defconfig changes"

    This reverts commit 97bb4a1d5d103804c72617481fca9b6cf93660a2.

commit c010e1a5176d73f3829ce49cfdb0fcc0ee5c777c
Author: Yue Hu <huyue2@coolpad.com>
Date:   Thu Apr 7 13:05:43 2022 +0800

    erofs: do not prompt for risk any more when using big pcluster

    The big pcluster feature has been merged for a year, it has been mostly
    stable now.

    Signed-off-by: Yue Hu <huyue2@coolpad.com>
    Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Link: https://lore.kernel.org/r/20220407050505.12683-1-huyue2@coolpad.com
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Signed-off-by: Cyber Knight <cyberknight755@gmail.com>

commit b135290ae7af3f5f7b69e24c6ca678c4f6572cf2
Author: John Galt <johngaltfirstrun@gmail.com>
Date:   Mon Jun 6 13:23:06 2022 -0400

    erofs: Squashed revert of some recent  backports:

    Keep out of release branch until
    d71eb1da8e8b59a7072c51ce48175e159ecfd79a is fixed, and also readmore
    decompress strategy is introduced.

    commit b9494371e2493f1a8ccc18b1c80f67867f6f623a
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:22:49 2022 -0400

        Revert "erofs: iomap support for non-tailpacking DIO"

        This reverts commit 804ddc92b769a9cc9926d0262725e6330d0f0a76.

    commit 0649a6ed5e759857aabc334abeddacbe4eac7859
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:22:41 2022 -0400

        Revert "erofs: adapt 3f4e33b91a28 to our tree"

        This reverts commit 016f1ffa36da74ab67ed99abd474a0b2da5133eb.

    commit a3704a5a79990f75c8336c9001939db6e6d21181
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:22:33 2022 -0400

        Revert "erofs: add support for the full decompressed length"

        This reverts commit a4a195b954114aeb741cf4f8b14256ed92e7c545.

    commit 5a506fe78d7624f1a94e60d0e3d7113ae6934ea7
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:22:27 2022 -0400

        Revert "erofs: add fiemap support with iomap"

        This reverts commit 07577933c3fb397791f113ad36fac7a061385826.

    commit dd93cf9efb3d1f9608780c44a50a860eb9921cf4
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:22:16 2022 -0400

        Revert "erofs: introduce chunk-based file on-disk format"

        This reverts commit 690f4dc6d3b27ed6278b8fbae20273883f616e56.

    commit a1846fe6257df43564f42eb153131796f3fd84ed
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:22:08 2022 -0400

        Revert "erofs: support reading chunk-based uncompressed files"

        This reverts commit 5bd83bfc55b6169af5bbf3c0ba4528577c2fa1ff.

    commit 3e1c2530db00b6605d8db09e207cb3633e61cdba
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:22:03 2022 -0400

        Revert "erofs: fix double free of 'copied'"

        This reverts commit c608a6f861e0d457d6c9a5905e8b3d928e672075.

    commit 7a9e0f351f8d41a01a0763316bbd4b6ace94bea0
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:21:52 2022 -0400

        Revert "erofs: fix misbehavior of unsupported chunk format check"

        This reverts commit 751e7c533e451b3c6a51f7d2a69224cca39e8c20.

    commit 37b05816e45d519643dd9d162b827311abf3b034
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:21:44 2022 -0400

        Revert "erofs: get compression algorithms directly on mapping"

        This reverts commit 98b09cde747826f6fe3aae50eb05659f7f2803f7.

    commit de74ca4af181a35ac037a44f07cf6a7e55e0f127
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:21:35 2022 -0400

        Revert "erofs: introduce the secondary compression head"

        This reverts commit feea4ee667bf5d5fa2c6d0c5f57697476dce7ca7.

    commit dda6e8eaddd3203cfafd6c82d2e751f2e6d16766
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:21:29 2022 -0400

        Revert "erofs: clean up z_erofs_extent_lookback"

        This reverts commit c08dbda40a4f3016ee6c60ae2a19e3ecc518361c.

    commit 2e5fd527a76eba733464b0ba71fe92abc839b62b
    Author: John Galt <johngaltfirstrun@gmail.com>
    Date:   Mon Jun 6 13:21:23 2022 -0400

        Revert "erofs: clean up erofs_map_blocks tracepoints"

        This reverts commit d71eb1da8e8b59a7072c51ce48175e159ecfd79a.

commit ed6e7f36515d6d80c75c4d0803b636e17f328a6c
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Thu Dec 9 09:29:18 2021 +0800

    erofs: clean up erofs_map_blocks tracepoints

    Since the new type of chunk-based files is introduced, there is no
    need to leave flatmode tracepoints.

    Rename to erofs_map_blocks instead.

    Link: https://lore.kernel.org/r/20211209012918.30337-1-hsiangkao@linux.alibaba.com
    Reviewed-by: Yue Hu <huyue2@yulong.com>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 525147ad9beef7e521c1667509db763e970c06d3
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Fri Mar 11 02:27:42 2022 +0800

    erofs: clean up z_erofs_extent_lookback

    Avoid the unnecessary tail recursion since it can be converted into
    a loop directly in order to prevent potential stack overflow.

    It's a pretty straightforward conversion.

    Link: https://lore.kernel.org/r/20220310182743.102365-1-hsiangkao@linux.alibaba.com
    Reviewed-by: Yue Hu <huyue2@coolpad.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit db45bcfb35a2cd8d49e159c0cc70635b713183a4
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Mon Oct 18 00:57:21 2021 +0800

    erofs: introduce the secondary compression head

    Previously, for each HEAD lcluster, it can be either HEAD or PLAIN
    lcluster to indicate whether the whole pcluster is compressed or not.

    In this patch, a new HEAD2 head type is introduced to specify another
    compression algorithm other than the primary algorithm for each
    compressed file, which can be used for upcoming LZMA compression and
    LZ4 range dictionary compression for various data patterns.

    It has been stayed in the EROFS roadmap for years. Complete it now!

    Link: https://lore.kernel.org/r/20211017165721.2442-1-xiang@kernel.org
    Reviewed-by: Yue Hu <huyue2@yulong.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit f0fe9e97d03ed484a51f764373ad0c5941949869
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Sat Oct 9 04:08:37 2021 +0800

    erofs: get compression algorithms directly on mapping

    Currently, z_erofs_map_blocks_iter() returns whether extents are
    compressed or not, and the decompression frontend gets the specific
    algorithms then.

    It works but not quite well in many aspests, for example:
     - The decompression frontend has to deal with whether extents are
       compressed or not again and lookup the algorithms if compressed.
       It's duplicated and too detailed about the on-disk mapping.

     - A new secondary compression head will be introduced later so that
       each file can have 2 compression algorithms at most for different
       type of data. It could increase the complexity of the decompression
       frontend if still handled in this way;

     - A new readmore decompression strategy will be introduced to get
       better performance for much bigger pcluster and lzma, which needs
       the specific algorithm in advance as well.

    Let's look up compression algorithms in z_erofs_map_blocks_iter()
    directly instead.

    Link: https://lore.kernel.org/r/20211008200839.24541-2-xiang@kernel.org
    Reviewed-by: Chao Yu <chao@kernel.org>
    Reviewed-by: Yue Hu <huyue2@yulong.com>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 588fc2156404c552d4c2c7bcc5def820966a1ba1
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Wed Sep 22 17:51:41 2021 +0800

    erofs: fix misbehavior of unsupported chunk format check

    Unsupported chunk format should be checked with
    "if (vi->chunkformat & ~EROFS_CHUNK_FORMAT_ALL)"

    Found when checking with 4k-byte blockmap (although currently mkfs
    uses inode chunk indexes format by default.)

    Link: https://lore.kernel.org/r/20210922095141.233938-1-hsiangkao@linux.alibaba.com
    Fixes: c5aa903a59db ("erofs: support reading chunk-based uncompressed files")
    Reviewed-by: Liu Bo <bo.liu@linux.alibaba.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 613122535bafaabb0e58a9c347c5b6f1b8e6fa91
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Wed Aug 25 20:07:57 2021 +0800

    erofs: fix double free of 'copied'

    Dan reported a new smatch warning [1]
    "fs/erofs/inode.c:210 erofs_read_inode() error: double free of 'copied'"

    Due to new chunk-based format handling logic, the error path can be
    called after kfree(copied).

    Set "copied = NULL" after kfree(copied) to fix this.

    [1] https://lore.kernel.org/r/202108251030.bELQozR7-lkp@intel.com

    Link: https://lore.kernel.org/r/20210825120757.11034-1-hsiangkao@linux.alibaba.com
    Fixes: c5aa903a59db ("erofs: support reading chunk-based uncompressed files")
    Reported-by: kernel test robot <lkp@intel.com>
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 7b648f684ea7c99deab7278f0c2cbbf74797a56d
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Fri Aug 20 18:00:19 2021 +0800

    erofs: support reading chunk-based uncompressed files

    Add runtime support for chunk-based uncompressed files
    described in the previous patch.

    Link: https://lore.kernel.org/r/20210820100019.208490-2-hsiangkao@linux.alibaba.com
    Reviewed-by: Liu Bo <bo.liu@linux.alibaba.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit d9737546275a3c460177a3ce9e01096bc3cfc3ad
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Fri Aug 20 18:00:18 2021 +0800

    erofs: introduce chunk-based file on-disk format

    Currently, uncompressed data except for tail-packing inline is
    consecutive on disk.

    In order to support chunk-based data deduplication, add a new
    corresponding inode data layout.

    In the future, the data source of chunks can be either (un)compressed.

    Link: https://lore.kernel.org/r/20210820100019.208490-1-hsiangkao@linux.alibaba.com
    Reviewed-by: Liu Bo <bo.liu@linux.alibaba.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 47f6bed39a7a83aa59be667657cba886dbd4b79b
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Fri Aug 13 13:29:31 2021 +0800

    erofs: add fiemap support with iomap

    This adds fiemap support for both uncompressed files and compressed
    files by using iomap infrastructure.

    Link: https://lore.kernel.org/r/20210813052931.203280-3-hsiangkao@linux.alibaba.com
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 82cc95ee585c9b033a43b0564173d4c444e3a4ac
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Wed Aug 18 23:22:31 2021 +0800

    erofs: add support for the full decompressed length

    Previously, there is no need to get the full decompressed length since
    EROFS supports partial decompression. However for some other cases
    such as fiemap, the full decompressed length is necessary for iomap to
    make it work properly.

    This patch adds a way to get the full decompressed length. Note that
    it takes more metadata overhead and it'd be avoided if possible in the
    performance sensitive scenario.

    Link: https://lore.kernel.org/r/20210818152231.243691-1-hsiangkao@linux.alibaba.com
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 8ff30ee6aaa1130bc26af4a98a818d91820c0bdb
Author: John Galt <johngaltfirstrun@gmail.com>
Date:   Thu May 12 12:08:04 2022 -0400

    erofs: adapt 3f4e33b91a28 to our tree

commit 71e2f8865698e382349a16d8f90e5d74f935ff2a
Author: Huang Jianan <huangjianan@oppo.com>
Date:   Thu Aug 5 08:35:59 2021 +0800

    erofs: iomap support for non-tailpacking DIO

    Add iomap support for non-tailpacking uncompressed data in order to
    support DIO and DAX.

    Direct I/O is useful in certain scenarios for uncompressed files.
    For example, double pagecache can be avoid by direct I/O when
    loop device is used for uncompressed files containing upper layer
    compressed filesystem.

    This adds iomap DIO support for non-tailpacking cases first and
    tail-packing inline files are handled in the follow-up patch.

    Link: https://lore.kernel.org/r/20210805003601.183063-2-hsiangkao@linux.alibaba.com
    Cc: linux-fsdevel@vger.kernel.org
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Huang Jianan <huangjianan@oppo.com>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 8bc571a229c3701405ac47f689db283ac99f2b2d
Author: Goldwyn Rodrigues <rgoldwyn@suse.com>
Date:   Fri Aug 30 12:09:24 2019 -0500

    fs: export generic_file_buffered_read()

    Export generic_file_buffered_read() to be used to supplement incomplete
    direct reads.

    Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
    Reviewed-by: David Sterba <dsterba@suse.com>
    Signed-off-by: David Sterba <dsterba@suse.com>

commit 34c8cbbc7b932ac50e90da6e838524fd1f162aca
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Wed Mar 7 15:26:44 2018 -0800

    fs, dax: prepare for dax-specific address_space_operations

    In preparation for the dax implementation to start associating dax pages
    to inodes via page->mapping, we need to provide a 'struct
    address_space_operations' instance for dax. Define some generic VFS aops
    helpers for dax. These noop implementations are there in the dax case to
    prevent the VFS from falling back to operations with page-cache
    assumptions, dax_writeback_mapping_range() may not be referenced in the
    FS_DAX=n case.

    Cc: Jeff Moyer <jmoyer@redhat.com>
    Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
    Suggested-by: Matthew Wilcox <mawilcox@microsoft.com>
    Suggested-by: Jan Kara <jack@suse.cz>
    Suggested-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Jan Kara <jack@suse.cz>
    Suggested-by: Dave Chinner <david@fromorbit.com>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

commit b0da008763834f165e8a055e011f223b3981316d
Author: Andreas Gruenbacher <agruenba@redhat.com>
Date:   Sun Oct 1 17:55:54 2017 -0400

    iomap: Switch from blkno to disk offset

    Replace iomap->blkno, the sector number, with iomap->addr, the disk
    offset in bytes.  For invalid disk offsets, use the special value
    IOMAP_NULL_ADDR instead of IOMAP_NULL_BLOCK.

    This allows to use iomap for mappings which are not block aligned, such
    as inline data on ext4.

    Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>  # iomap, xfs
    Reviewed-by: Jan Kara <jack@suse.cz>

commit b74997cce993dd0408a0beeb36bd28652e272108
Author: Matthew Wilcox <mawilcox@microsoft.com>
Date:   Tue Nov 28 15:39:51 2017 -0500

    idr: Rename idr_for_each_entry_ext

    Most places in the kernel that we need to distinguish functions by the
    type of their arguments, we use '_ul' as a suffix for the unsigned long
    variant, not '_ext'.  Also add kernel-doc.

    Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>

commit a562faeba73cfb13de1f278c95be606faa3e4f21
Author: Matthew Wilcox <mawilcox@microsoft.com>
Date:   Tue Nov 28 10:14:27 2017 -0500

    idr: Add idr_alloc_u32 helper

    All current users of idr_alloc_ext() actually want to allocate a u32
    and idr_alloc_u32() fits their needs better.

    Like idr_get_next(), it uses a 'nextid' argument which serves as both
    a pointer to the start ID and the assigned ID (instead of a separate
    minimum and pointer-to-assigned-ID argument).  It uses a 'max' argument
    rather than 'end' because the semantics that idr_alloc has for 'end'
    don't work well for unsigned types.

    Since idr_alloc_u32() returns an errno instead of the allocated ID, mark
    it as __must_check to help callers use it correctly.  Include copious
    kernel-doc.  Chris Mi <chrism@mellanox.com> has promised to contribute
    test-cases for idr_alloc_u32.

    Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>

commit 4b24e4564260899c64b9532440a9b5545dbfe7f9
Author: Matthew Wilcox <mawilcox@microsoft.com>
Date:   Tue Apr 10 16:36:48 2018 -0700

    fscache: use appropriate radix tree accessors

    Don't open-code accesses to data structure internals.

    Link: http://lkml.kernel.org/r/20180313132639.17387-7-willy@infradead.org
    Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
    Reviewed-by: Jeff Layton <jlayton@redhat.com>
    Cc: Darrick J. Wong <darrick.wong@oracle.com>
    Cc: Dave Chinner <david@fromorbit.com>
    Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

commit 7469480be01c3394807cbd0991f06b8d6f2d4403
Author: Matthew Wilcox <mawilcox@microsoft.com>
Date:   Tue Apr 10 16:36:44 2018 -0700

    export __set_page_dirty

    XFS currently contains a copy-and-paste of __set_page_dirty().  Export
    it from buffer.c instead.

    Link: http://lkml.kernel.org/r/20180313132639.17387-6-willy@infradead.org
    Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
    Acked-by: Jeff Layton <jlayton@kernel.org>
    Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
    Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: Dave Chinner <david@fromorbit.com>
    Cc: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

commit c53045287025992bc775081dbab63ac926a597e8
Author: Matthew Wilcox <mawilcox@microsoft.com>
Date:   Tue Apr 10 16:36:28 2018 -0700

    radix tree: use GFP_ZONEMASK bits of gfp_t for flags

    Patch series "XArray", v9.  (First part thereof).

    This patchset is, I believe, appropriate for merging for 4.17.  It
    contains the XArray implementation, to eventually replace the radix
    tree, and converts the page cache to use it.

    This conversion keeps the radix tree and XArray data structures in sync
    at all times.  That allows us to convert the page cache one function at
    a time and should allow for easier bisection.  Other than renaming some
    elements of the structures, the data structures are fundamentally
    unchanged; a radix tree walk and an XArray walk will touch the same
    number of cachelines.  I have changes planned to the XArray data
    structure, but those will happen in future patches.

    Improvements the XArray has over the radix tree:

     - The radix tree provides operations like other trees do; 'insert' and
       'delete'. But what most users really want is an automatically
       resizing array, and so it makes more sense to give users an API that
       is like an array -- 'load' and 'store'. We still have an 'insert'
       operation for users that really want that semantic.

     - The XArray considers locking as part of its API. This simplifies a
       lot of users who formerly had to manage their own locking just for
       the radix tree. It also improves code generation as we can now tell
       RCU that we're holding a lock and it doesn't need to generate as much
       fencing code. The other advantage is that tree nodes can be moved
       (not yet implemented).

     - GFP flags are now parameters to calls which may need to allocate
       memory. The radix tree forced users to decide what the allocation
       flags would be at creation time. It's much clearer to specify them at
       allocation time.

     - Memory is not preloaded; we don't tie up dozens of pages on the off
       chance that the slab allocator fails. Instead, we drop the lock,
       allocate a new node and retry the operation. We have to convert all
       the radix tree, IDA and IDR preload users before we can realise this
       benefit, but I have not yet found a user which cannot be converted.

     - The XArray provides a cmpxchg operation. The radix tree forces users
       to roll their own (and at least four have).

     - Iterators take a 'max' parameter. That simplifies many users and will
       reduce the amount of iteration done.

     - Iteration can proceed backwards. We only have one user for this, but
       since it's called as part of the pagefault readahead algorithm, that
       seemed worth mentioning.

     - RCU-protected pointers are not exposed as part of the API. There are
       some fun bugs where the page cache forgets to use rcu_dereference()
       in the current codebase.

     - Value entries gain an extra bit compared to radix tree exceptional
       entries. That gives us the extra bit we need to put huge page swap
       entries in the page cache.

     - Some iterators now take a 'filter' argument instead of having
       separate iterators for tagged/untagged iterations.

    The page cache is improved by this:

     - Shorter, easier to read code

     - More efficient iterations

     - Reduction in size of struct address_space

     - Fewer walks from the top of the data structure; the XArray API
       encourages staying at the leaf node and conducting operations there.

    This patch (of 8):

    None of these bits may be used for slab allocations, so we can use them
    as radix tree flags as long as we mask them off before passing them to
    the slab allocator. Move the IDR flag from the high bits to the
    GFP_ZONEMASK bits.

    Link: http://lkml.kernel.org/r/20180313132639.17387-3-willy@infradead.org
    Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
    Acked-by: Jeff Layton <jlayton@kernel.org>
    Cc: Darrick J. Wong <darrick.wong@oracle.com>
    Cc: Dave Chinner <david@fromorbit.com>
    Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

commit c95250f9f545568b87775f1a2a48d412203161f7
Author: John Galt <johngaltfirstrun@gmail.com>
Date:   Mon May 16 10:45:14 2022 -0400

    Revert "erofs: compression fixes"

    This reverts commit 208dabff2d5e3e616a86df8bdba814d54b1a8a1f.

    Fixes a deadlock when fix shrinking erofs slab.

commit d07627505cd871bb1a539377434dede2f4a18d9c
Author: John Galt <johngaltfirstrun@gmail.com>
Date:   Mon May 16 09:41:14 2022 -0400

    Revert "erofs: fixes for compilation"

    This reverts commit c7bf11979051cda0e7b37857289503fa4831c549.

commit 7846d0f267ba3572570917e4880d60c79939bf5c
Author: Hongyu Jin <hongyu.jin@unisoc.com>
Date:   Fri Apr 1 19:55:27 2022 +0800

    erofs: fix use-after-free of on-stack io[]

    The root cause is the race as follows:
    Thread #1                              Thread #2(irq ctx)

    z_erofs_runqueue()
      struct z_erofs_decompressqueue io_A[];
      submit bio A
      z_erofs_decompress_kickoff(,,1)
                                           z_erofs_decompressqueue_endio(bio A)
                                           z_erofs_decompress_kickoff(,,-1)
                                           spin_lock_irqsave()
                                           atomic_add_return()
      io_wait_event()	-> pending_bios is already 0
      [end of function]
                                           wake_up_locked(io_A[]) // crash

    Referenced backtrace in kernel 5.4:

    [   10.129422] Unable to handle kernel paging request at virtual address eb0454a4
    [   10.364157] CPU: 0 PID: 709 Comm: getprop Tainted: G        WC O      5.4.147-ab09225 #1
    [   11.556325] [<c01b33b8>] (__wake_up_common) from [<c01b3300>] (__wake_up_locked+0x40/0x48)
    [   11.565487] [<c01b3300>] (__wake_up_locked) from [<c044c8d0>] (z_erofs_vle_unzip_kickoff+0x6c/0xc0)
    [   11.575438] [<c044c8d0>] (z_erofs_vle_unzip_kickoff) from [<c044c854>] (z_erofs_vle_read_endio+0x16c/0x17c)
    [   11.586082] [<c044c854>] (z_erofs_vle_read_endio) from [<c06a80e8>] (clone_endio+0xb4/0x1d0)
    [   11.595428] [<c06a80e8>] (clone_endio) from [<c04a1280>] (blk_update_request+0x150/0x4dc)
    [   11.604516] [<c04a1280>] (blk_update_request) from [<c06dea28>] (mmc_blk_cqe_complete_rq+0x144/0x15c)
    [   11.614640] [<c06dea28>] (mmc_blk_cqe_complete_rq) from [<c04a5d90>] (blk_done_softirq+0xb0/0xcc)
    [   11.624419] [<c04a5d90>] (blk_done_softirq) from [<c010242c>] (__do_softirq+0x184/0x56c)
    [   11.633419] [<c010242c>] (__do_softirq) from [<c01051e8>] (irq_exit+0xd4/0x138)
    [   11.641640] [<c01051e8>] (irq_exit) from [<c010c314>] (__handle_domain_irq+0x94/0xd0)
    [   11.650381] [<c010c314>] (__handle_domain_irq) from [<c04fde70>] (gic_handle_irq+0x50/0xd4)
    [   11.659641] [<c04fde70>] (gic_handle_irq) from [<c0101b70>] (__irq_svc+0x70/0xb0)

    Signed-off-by: Hongyu Jin <hongyu.jin@unisoc.com>
    Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Link: https://lore.kernel.org/r/20220401115527.4935-1-hongyu.jin.cn@gmail.com
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 9fa705504bf016a360c10edc3c9c5cbf8d870a78
Author: John Galt <johngaltfirstrun@gmail.com>
Date:   Thu May 5 22:40:43 2022 -0400

    erofs: extend 3812dc21ec

commit 4cda8c8c3d0ea4b3cb0f660db01697b50f7bfddc
Author: Yue Hu <huyue2@yulong.com>
Date:   Thu Oct 14 14:57:44 2021 +0800

    erofs: remove the fast path of per-CPU buffer decompression

    As Xiang mentioned, such path has no real impact to our current
    decompression strategy, remove it directly. Also, update the return
    value of z_erofs_lz4_decompress() to 0 if success to keep consistent
    with LZMA which will return 0 as well for that case.

    Link: https://lore.kernel.org/r/20211014065744.1787-1-zbestahu@gmail.com
    Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Signed-off-by: Yue Hu <huyue2@yulong.com>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 20122adf7721eff6c6ff90db545e0597501d942f
Author: Yue Hu <huyue2@yulong.com>
Date:   Tue Sep 14 11:59:15 2021 +0800

    erofs: clear compacted_2b if compacted_4b_initial > totalidx

    Currently, the whole indexes will only be compacted 4B if
    compacted_4b_initial > totalidx. So, the calculated compacted_2b
    is worthless for that case. It may waste CPU resources.

    No need to update compacted_4b_initial as mkfs since it's used to
    fulfill the alignment of the 1st compacted_2b pack and would handle
    the case above.

    We also need to clarify compacted_4b_end here. It's used for the
    last lclusters which aren't fitted in the previous compacted_2b
    packs.

    Some messages are from Xiang.

    Link: https://lore.kernel.org/r/20210914035915.1190-1-zbestahu@gmail.com
    Signed-off-by: Yue Hu <huyue2@yulong.com>
    Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    [ Gao Xiang: it's enough to use "compacted_4b_initial < totalidx". ]
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 3243783e85d10ccc00b9e8cb37960ed1fc1e9fef
Author: Yue Hu <huyue2@yulong.com>
Date:   Tue Aug 10 15:24:16 2021 +0800

    erofs: remove the mapping parameter from erofs_try_to_free_cached_page()

    The mapping is not used at all, remove it and update related code.

    Link: https://lore.kernel.org/r/20210810072416.1392-1-zbestahu@gmail.com
    Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Yue Hu <huyue2@yulong.com>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 2936d3798b6c340459813a0eeb2409a4cb34e44f
Author: Yue Hu <huyue2@yulong.com>
Date:   Tue Aug 10 14:54:50 2021 +0800

    erofs: directly use wrapper erofs_page_is_managed() when shrinking

    We already have the wrapper function to identify managed page.

    Link: https://lore.kernel.org/r/20210810065450.1320-1-zbestahu@gmail.com
    Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Yue Hu <huyue2@yulong.com>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

commit 09b3effb67cdec2ce718d83a363c0a2df5f3d372
Author: Yue Hu <huyue2@yulong.com>
Date:   Mon Apr 19 18:26:23 2021 +0800

    erofs: remove the occupied parameter from z_erofs_pagevec_enqueue()

    No any behavior to variable occupied in z_erofs_attach_page() which
    is only caller to z_erofs_pagevec_enqueue().

    Link: https://lore.kernel.org/r/20210419102623.2015-1-zbestahu@gmail.com
    Signed-off-by: Yue Hu <huyue2@yulong.com>
    Reviewed-by: Gao Xiang <xiang@kernel.org>
    Signed-off-by: Gao Xiang <xiang@kernel.org>

commit b5b28aefcf024c86c3f930293ba36482f96faf34
Author: Gao Xiang <xiang@kernel.org>
Date:   Mon May 10 14:47:15 2021 +0800

    erofs: fix 1 lcluster-sized pcluster for big pcluster

    If the 1st NONHEAD lcluster of a pcluster isn't CBLKCNT lcluster type
    rather than a HEAD or PLAIN type instead, which means its pclustersize
    _must_ be 1 lcluster (since its uncompressed size < 2 lclusters),
    as illustrated below:

           HEAD     HEAD / PLAIN    lcluster type
       ____________ ____________
      |_:__________|_________:__|   file data (uncompressed)
       .                .
      .____________.
      |____________|                pcluster data (compressed)

    Such on-disk case was explained before [1] but missed to be handled
    properly in the runtime implementation.

    It can be observed if manually generating 1 lcluster-sized pcluster
    with 2 lclusters (thus CBLKCNT doesn't exist.) Let's fix it now.

    [1] https://lore.kernel.org/r/20210407043927.10623-1-xiang@kernel.org

    Link: https://lore.kernel.org/r/20210510064715.29123-1-xiang@kernel.org
    Fixes: cec6e93beadf ("erofs: support parsing big pcluster compress indexes")
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <xiang@kernel.org>

commit 2cfa0bcf32db1431e18d636e0ff5c592768b9620
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Wed Apr 7 12:39:27 2021 +0800

    erofs: enable big pcluster feature

    Enable COMPR_CFGS and BIG_PCLUSTER since the implementations are
    all settled properly.

    Link: https://lore.kernel.org/r/20210407043927.10623-11-xiang@kernel.org
    Acked-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit d75144d8d0395bca0a1a629a3b9ab6a95112a083
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Wed Apr 7 12:39:26 2021 +0800

    erofs: support decompress big pcluster for lz4 backend

    Prior to big pcluster, there was only one compressed page so it'd
    easy to map this. However, when big pcluster is enabled, more work
    needs to be done to handle multiple compressed pages. In detail,

     - (maptype 0) if there is only one compressed page + no need
       to copy inplace I/O, just map it directly what we did before;

     - (maptype 1) if there are more compressed pages + no need to
       copy inplace I/O, vmap such compressed pages instead;

     - (maptype 2) if inplace I/O needs to be copied, use per-CPU
       buffers for decompression then.

    Another thing is how to detect inplace decompression is feasable or
    not (it's still quite easy for non big pclusters), apart from the
    inplace margin calculation, inplace I/O page reusing order is also
    needed to be considered for each compressed page. Currently, if the
    compressed page is the xth page, it shouldn't be reused as [0 ...
    nrpages_out - nrpages_in + x], otherwise a full copy will be triggered.

    Although there are some extra optimization ideas for this, I'd like
    to make big pcluster work correctly first and obviously it can be
    further optimized later since it has nothing with the on-disk format
    at all.

    Link: https://lore.kernel.org/r/20210407043927.10623-10-xiang@kernel.org
    Acked-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit f344f71c42af2866c748ae22e1b133a02594b367
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Wed Apr 7 12:39:25 2021 +0800

    erofs: support parsing big pcluster compact indexes

    Different from non-compact indexes, several lclusters are packed
    as the compact form at once and an unique base blkaddr is stored for
    each pack, so each lcluster index would take less space on avarage
    (e.g. 2 bytes for COMPACT_2B.) btw, that is also why BIG_PCLUSTER
    switch should be consistent for compact head0/1.

    Prior to big pcluster, the size of all pclusters was 1 lcluster.
    Therefore, when a new HEAD lcluster was scanned, blkaddr would be
    bumped by 1 lcluster. However, that way doesn't work anymore for
    big pcluster since we actually don't know the compressed size of
    pclusters in advance (before reading CBLKCNT lcluster).

    So, instead, let blkaddr of each pack be the first pcluster blkaddr
    with a valid CBLKCNT, in detail,

     1) if CBLKCNT starts at the pack, this first valid pcluster is
        itself, e.g.
      _____________________________________________________________
     |_CBLKCNT0_|_NONHEAD_| .. |_HEAD_|_CBLKCNT1_| ... |_HEAD_| ...
     ^ = blkaddr base          ^ += CBLKCNT0           ^ += CBLKCNT1

     2) if CBLKCNT doesn't start at the pack, the first valid pcluster
        is the next pcluster, e.g.
      _________________________________________________________
     | NONHEAD_| .. |_HEAD_|_CBLKCNT0_| ... |_HEAD_|_HEAD_| ...
                    ^ = blkaddr base        ^ += CBLKCNT0
                                                   ^ += 1

    When a CBLKCNT is found, blkaddr will be increased by CBLKCNT
    lclusters, or a new HEAD is found immediately, bump blkaddr by 1
    instead (see the picture above.)

    Also noted if CBLKCNT is the end of the pack, instead of storing
    delta1 (distance of the next HEAD lcluster) as normal NONHEADs,
    it still uses the compressed block count (delta0) since delta1
    can be calculated indirectly but the block count can't.

    Adjust decoding logic to fit big pcluster compact indexes as well.

    Link: https://lore.kernel.org/r/20210407043927.10623-9-xiang@kernel.org
    Acked-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 7af2a5cf065073d6f43298b2c96676f9315709d5
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Wed Apr 7 12:39:24 2021 +0800

    erofs: support parsing big pcluster compress indexes

    When INCOMPAT_BIG_PCLUSTER sb feature is enabled, legacy compress indexes
    will also have the same on-disk header compact indexes to keep per-file
    configurations instead of leaving it zeroed.

    If ADVISE_BIG_PCLUSTER is set for a file, CBLKCNT will be loaded for each
    pcluster in this file by parsing 1st non-head lcluster.

    Link: https://lore.kernel.org/r/20210407043927.10623-8-xiang@kernel.org
    Acked-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 81a0c5100c6b09b91b7cfdad429fc66d65335be2
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Wed Apr 7 12:39:23 2021 +0800

    erofs: adjust per-CPU buffers according to max_pclusterblks

    Adjust per-CPU buffers on demand since big pcluster definition is
    available. Also, bail out unsupported pcluster size according to
    Z_EROFS_PCLUSTER_MAX_SIZE.

    Link: https://lore.kernel.org/r/20210407043927.10623-7-xiang@kernel.org
    Acked-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 56612c78a9aeefc38d6b9bd7a6fef06eebe0c4b6
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Wed Apr 7 12:39:22 2021 +0800

    erofs: add big physical cluster definition

    Big pcluster indicates the size of compressed data for each physical
    pcluster is no longer fixed as block size, but could be more than 1
    block (more accurately, 1 logical pcluster)

    When big pcluster feature is enabled for head0/1, delta0 of the 1st
    non-head lcluster index will keep block count of this pcluster in
    lcluster size instead of 1. Or, the compressed size of pcluster
    should be 1 lcluster if pcluster has no non-head lcluster index.

    Also note that BIG_PCLUSTER feature reuses COMPR_CFGS feature since
    it depends on COMPR_CFGS and will be released together.

    Link: https://lore.kernel.org/r/20210407043927.10623-6-xiang@kernel.org
    Acked-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit a67309917444753f1cebfee2d2503cf68269e54a
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Wed Apr 7 12:39:21 2021 +0800

    erofs: fix up inplace I/O pointer for big pcluster

    When picking up inplace I/O pages, it should be traversed in reverse
    order in aligned with the traversal order of file-backed online pages.
    Also, index should be updated together when preloading compressed pages.

    Previously, only page-sized pclustersize was supported so no problem
    at all. Also rename `compressedpages' to `icpage_ptr' to reflect its
    functionality.

    Link: https://lore.kernel.org/r/20210407043927.10623-5-xiang@kernel.org
    Acked-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 8fabf77d1a435d68b2bbb89c51f8351ef8efed26
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Wed Apr 7 12:39:20 2021 +0800

    erofs: introduce physical cluster slab pools

    Since multiple pcluster sizes could be used at once, the number of
    compressed pages will become a variable factor. It's necessary to
    introduce slab pools rather than a single slab cache now.

    This limits the pclustersize to 1M (Z_EROFS_PCLUSTER_MAX_SIZE), and
    get rid of the obsolete EROFS_FS_CLUSTER_PAGE_LIMIT, which has no
    use now.

    Link: https://lore.kernel.org/r/20210407043927.10623-4-xiang@kernel.org
    Acked-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit c9b891a3fd81d315815f496f1282c95e98507812
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Sat Apr 10 03:06:30 2021 +0800

    erofs: introduce multipage per-CPU buffers

    To deal the with the cases which inplace decompression is infeasible
    for some inplace I/O. Per-CPU buffers was introduced to get rid of page
    allocation latency and thrash for low-latency decompression algorithms
    such as lz4.

    For the big pcluster feature, introduce multipage per-CPU buffers to
    keep such inplace I/O pclusters temporarily as well but note that
    per-CPU pages are just consecutive virtually.

    When a new big pcluster fs is mounted, its max pclustersize will be
    read and per-CPU buffers can be growed if needed. Shrinking adjustable
    per-CPU buffers is more complex (because we don't know if such size
    is still be used), so currently just release them all when unloading.

    Link: https://lore.kernel.org/r/20210409190630.19569-1-xiang@kernel.org
    Acked-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 6751c7549b38cfe2044fc3d6e03c25c0067e700d
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Wed Apr 7 12:39:18 2021 +0800

    erofs: reserve physical_clusterbits[]

    Formal big pcluster design is actually more powerful / flexable than
    the previous thought whose pclustersize was fixed as power-of-2 blocks,
    which was obviously inefficient and space-wasting. Instead, pclustersize
    can now be set independently for each pcluster, so various pcluster
    sizes can also be used together in one file if mkfs wants (for example,
    according to data type and/or compression ratio).

    Let's get rid of previous physical_clusterbits[] setting (also notice
    that corresponding on-disk fields are still 0 for now). Therefore,
    head1/2 can be used for at most 2 different algorithms in one file and
    again pclustersize is now independent of these.

    Link: https://lore.kernel.org/r/20210407043927.10623-2-xiang@kernel.org
    Acked-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 7c717bd2fb96a7ee82346bc88ddd28c5812c689d
Author: Ruiqi Gong <gongruiqi1@huawei.com>
Date:   Wed Mar 31 05:39:20 2021 -0400

    erofs: Clean up spelling mistakes found in fs/erofs

    zmap.c: s/correspoinding/corresponding
    zdata.c: s/endding/ending

    Link: https://lore.kernel.org/r/20210331093920.31923-1-gongruiqi1@huawei.com
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Signed-off-by: Ruiqi Gong <gongruiqi1@huawei.com>
    Reviewed-by: Gao Xiang <hsiangkao@redhat.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 44f277dee13de691fe1fc483b55b4bc8ade3da36
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Mon Mar 29 18:00:12 2021 +0800

    erofs: add on-disk compression configurations

    Add a bitmap for available compression algorithms and a variable-sized
    on-disk table for compression options in preparation for upcoming big
    pcluster and LZMA algorithm, which follows the end of super block.

    To parse the compression options, the bitmap is scanned one by one.
    For each available algorithm, there is data followed by 2-byte `length'
    correspondingly (it's enough for most cases, or entire fs blocks should
    be used.)

    With such available algorithm bitmap, kernel itself can also refuse to
    mount such filesystem if any unsupported compression algorithm exists.

    Note that COMPR_CFGS feature will be enabled with BIG_PCLUSTER.

    Link: https://lore.kernel.org/r/20210329100012.12980-1-hsiangkao@aol.com
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit e43a280cd5ca073e9d8cfa0471cdabf8f8500181
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Mon Mar 29 09:23:07 2021 +0800

    erofs: introduce on-disk lz4 fs configurations

    Introduce z_erofs_lz4_cfgs to store all lz4 configurations.
    Currently it's only max_distance, but will be used for new
    features later.

    Link: https://lore.kernel.org/r/20210329012308.28743-4-hsiangkao@aol.com
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit d4108bf277b411bfdfa0eb12c2172b4035471d8b
Author: Huang Jianan <huangjianan@oppo.com>
Date:   Mon Mar 29 09:23:06 2021 +0800

    erofs: support adjust lz4 history window size

    lz4 uses LZ4_DISTANCE_MAX to record history preservation. When
    using rolling decompression, a block with a higher compression
    ratio will cause a larger memory allocation (up to 64k). It may
    cause a large resource burden in extreme cases on devices with
    small memory and a large number of concurrent IOs. So appropriately
    reducing this value can improve performance.

    Decreasing this value will reduce the compression ratio (except
    when input_size <LZ4_DISTANCE_MAX). But considering that erofs
    currently only supports 4k output, reducing this value will not
    significantly reduce the compression benefits.

    The maximum value of LZ4_DISTANCE_MAX defined by lz4 is 64k, and
    we can only reduce this value. For the old kernel, it just can't
    reduce the memory allocation during rolling decompression without
    affecting the decompression result.

    Link: https://lore.kernel.org/r/20210329012308.28743-3-hsiangkao@aol.com
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Huang Jianan <huangjianan@oppo.com>
    Signed-off-by: Guo Weichao <guoweichao@oppo.com>
    [ Gao Xiang: introduce struct erofs_sb_lz4_info for configurations. ]
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 89a30917b8f584f34216b053ff5e4b8e1fa1a81a
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Mon Mar 29 09:23:05 2021 +0800

    erofs: introduce erofs_sb_has_xxx() helpers

    Introduce erofs_sb_has_xxx() to make long checks short, especially
    for later big pcluster & LZMA features.

    Link: https://lore.kernel.org/r/20210329012308.28743-2-hsiangkao@aol.com
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 83849318acff8125846f2447ed318f80db4dde38
Author: Yue Hu <huyue2@yulong.com>
Date:   Thu Mar 25 15:10:08 2021 +0800

    erofs: don't use erofs_map_blocks() any more

    Currently, erofs_map_blocks() will be called only from
    erofs_{bmap, read_raw_page} which are all for uncompressed files.
    So, the compression branch in erofs_map_blocks() is pointless. Let's
    remove it and use erofs_map_blocks_flatmode() directly. Also update
    related comments.

    Link: https://lore.kernel.org/r/20210325071008.573-1-zbestahu@gmail.com
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Yue Hu <huyue2@yulong.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit dd3b7a71fb79a620a8df1138d74c990df27e04a5
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Mon Mar 22 02:32:27 2021 +0800

    erofs: complete a missing case for inplace I/O

    Add a missing case which could cause unnecessary page allocation but
    not directly use inplace I/O instead, which increases runtime extra
    memory footprint.

    The detail is, considering an online file-backed page, the right half
    of the page is chosen to be cached (e.g. the end page of a readahead
    request) and some of its data doesn't exist in managed cache, so the
    pcluster will be definitely kept in the submission chain. (IOWs, it
    cannot be decompressed without I/O, e.g., due to the bypass queue).

    Currently, DELAYEDALLOC/TRYALLOC cases can be downgraded as NOINPLACE,
    and stop online pages from inplace I/O. After this patch, unneeded page
    allocations won't be observed in pickup_page_for_submission() then.

    Link: https://lore.kernel.org/r/20210321183227.5182-1-hsiangkao@aol.com
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 2195652f604a78eff0b808c94f7c31c0648d42e8
Author: Huang Jianan <huangjianan@oppo.com>
Date:   Wed Mar 17 11:54:47 2021 +0800

    erofs: use workqueue decompression for atomic contexts only

    z_erofs_decompressqueue_endio may not be executed in the atomic
    context, for example, when dm-verity is turned on. In this scenario,
    data can be decompressed directly to get rid of additional kworker
    scheduling overhead.

    Link: https://lore.kernel.org/r/20210317035448.13921-2-huangjianan@oppo.com
    Reviewed-by: Gao Xiang <hsiangkao@redhat.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Huang Jianan <huangjianan@oppo.com>
    Signed-off-by: Guo Weichao <guoweichao@oppo.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 50a12c462dbc5e3e4d14dc427392fc8e571b1b0b
Author: Huang Jianan <huangjianan@oppo.com>
Date:   Tue Mar 16 11:15:14 2021 +0800

    erofs: avoid memory allocation failure during rolling decompression

    Currently, err would be treated as io error. Therefore, it'd be
    better to ensure memory allocation during rolling decompression
    to avoid such io error.

    In the long term, we might consider adding another !Uptodate case
    for such case.

    Link: https://lore.kernel.org/r/20210316031515.90954-1-huangjianan@oppo.com
    Reviewed-by: Gao Xiang <hsiangkao@redhat.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Huang Jianan <huangjianan@oppo.com>
    Signed-off-by: Guo Weichao <guoweichao@oppo.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

commit 5a664357076596a3af1100413bafb00a88dc5ef2
Author: kondors1995 <normandija1945@gmail.com>
Date:   Mon May 9 16:44:49 2022 +0000

    raphael_defconfig: Enable EROFS

commit 2409ea765730e7ca72fcc71dc3989eb37306ed81
Author: Tom Levy <tomlevy93@gmail.com>
Date:   Tue Jul 16 16:30:24 2019 -0700

    include/linux/lz4.h: fix spelling and copy-paste errors in documentation

    Fix a few spelling and grammar errors, and two places where fast/safe in
    the documentation did not match the function.

    Link: http://lkml.kernel.org/r/20190321014452.13297-1-tomlevy93@gmail.com
    Signed-off-by: Tom Levy <tomlevy93@gmail.com>
    Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
    Cc: Jiri Kosina <trivial@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>

commit 416572f0ce1a90146cb73dd5ea3667899d0f8241
Author: John Galt <johngaltfirstrun@gmail.com>
Date:   Tue May 3 16:09:48 2022 -0400

    erofs: compression fixes

commit 8af69e641af0cd017664fbf2fbd9ce2509b2b8dc
Author: Luan Cachoroski Halaiko <luhalaiko@gmail.com>
Date:   Tue Feb 8 20:20:47 2022 -0300

    erofs: fixes for compilation

    Signed-off-by: Luan Cachoroski Halaiko <luhalaiko@gmail.com>

commit ad81e37ce0d0af5bdb0115a7eccd673c03d293f0
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Wed Dec 9 20:37:17 2020 +0800

    erofs: force inplace I/O under low memory scenario

    Try to forcely switch to inplace I/O under low memory scenario in
    order to avoid direct memory reclaim due to cached page allocation.

    Link: https://lore.kernel.org/r/20201209123717.12430-1-hsiangkao@aol.com
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
    Change-Id: I8ea2d3b59c68125271f66853cf5dc6ca39e7aaa9

commit e4018facd91f25eb223b94416d1b64f641618577
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Tue Dec 8 17:58:34 2020 +0800

    erofs: simplify try_to_claim_pcluster()

    simplify try_to_claim_pcluster() by directly using cmpxchg() here
    (the retry loop caused more overhead.) Also, move the chain loop
    detection in and rename it to z_erofs_try_to_claim_pcluster().

    Link: https://lore.kernel.org/r/20201208095834.3133565-3-hsiangkao@redhat.com
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
    Change-Id: I8d091ff44123b099ef199eaa4200a00b8854623f

commit f28d114732f644b4a6445316095db1f0e818472f
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Tue Dec 8 17:58:33 2020 +0800

    erofs: insert to managed cache after adding to pcl

    Previously, it could be some concern to call add_to_page_cache_lru()
    with page->mapping == Z_EROFS_MAPPING_STAGING (!= NULL).

    In contrast, page->private is used instead now, so partially revert
    commit 5ddcee1f3a1c ("erofs: get rid of __stagingpage_alloc helper")
    with some adaption for simplicity.

    Link: https://lore.kernel.org/r/20201208095834.3133565-2-hsiangkao@redhat.com
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
    Change-Id: If250d62b47083649e96d0937eb1990b6c84d768f

commit 1a79fe1a476ae08ed0609618951fe863df0ac03a
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Tue Dec 8 17:58:32 2020 +0800

    erofs: get rid of magical Z_EROFS_MAPPING_STAGING

    Previously, we played around with magical page->mapping for short-lived
    temporary pages since we need to identify different types of pages in
    the same pcluster but both invalidated and short-lived temporary pages
    can have page->mapping == NULL. It was considered as safe because that
    temporary pages are all non-LRU / non-movable pages.

    This patch tends to use specific page->private to identify short-lived
    pages instead so it won't rely on page->mapping anymore. Details are
    described in "compress.h" as well.

    Link: https://lore.kernel.org/r/20201208095834.3133565-1-hsiangkao@redhat.com
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
    Change-Id: I2c8650e80cb6016ed828d04f89f8bd3512ca3fb2

commit a50789da7af81e73a8cb0081e788cea5543eff5c
Author: Vladimir Zapolskiy <vladimir@tuxera.com>
Date:   Fri Oct 30 14:28:39 2020 +0200

    erofs: remove a void EROFS_VERSION macro set in Makefile

    Since commit 4f761fa253b4 ("erofs: rename errln/infoln/debugln to
    erofs_{err, info, dbg}") the defined macro EROFS_VERSION has no affect,
    therefore removing it from the Makefile is a non-functional change.

    Link: https://lore.kernel.org/r/20201030122839.25431-1-vladimir@tuxera.com
    Reviewed-by: Gao Xiang <hsiangkao@redhat.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Vladimir Zapolskiy <vladimir@tuxera.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
    Change-Id: Id63ad279985db2a156d62be814bf381c9bea8342

commit d929ef94d4aab35ae96fb6d6efd1a0a23f7d1b48
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Mon Aug 30 11:44:53 2021 +0800

    erofs: move from drivers/staging/ to fs/

    Since 5.4, erofs has been moved into fs/.

    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Change-Id: I95dd967a0097629a9d8eaed1dc11e2cd04f47701

commit 2758a8239cc772c63d5463073b44626ee4e7695a
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date:   Wed Aug 25 11:42:03 2021 +0800

    erofs: sync up with kernel 5.10

    Backport 5.10 LTS erofs to 4.19.

    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Change-Id: Ibf9c0c47e46090b72e75f09a347100f4ff64f28d

commit 1ee3b56216b0d92e2134d6134d2027c842f495b6
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Mon Mar 29 08:36:14 2021 +0800

    erofs: add unsupported inode i_format check

    commit 24a806d849c0b0c1d0cd6a6b93ba4ae4c0ec9f08 upstream.

    If any unknown i_format fields are set (may be of some new incompat
    inode features), mark such inode as unsupported.

    Just in case of any new incompat i_format fields added in the future.

    Link: https://lore.kernel.org/r/20210329003614.6583-1-hsiangkao@aol.com
    Fixes: 431339ba9042 ("staging: erofs: add inode operations")
    Cc: <stable@vger.kernel.org> # 4.19+
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 316472dda45a6a8142fc80800fa92f2846911008
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Thu Jul 30 01:58:01 2020 +0800

    erofs: fix extended inode could cross boundary

    commit 0dcd3c94e02438f4a571690e26f4ee997524102a upstream.

    Each ondisk inode should be aligned with inode slot boundary
    (32-byte alignment) because of nid calculation formula, so all
    compact inodes (32 byte) cannot across page boundary. However,
    extended inode is now 64-byte form, which can across page boundary
    in principle if the location is specified on purpose, although
    it's hard to be generated by mkfs due to the allocation policy
    and rarely used by Android use case now mainly for > 4GiB files.

    For now, only two fields `i_ctime_nsec` and `i_nlink' couldn't
    be read from disk properly and cause out-of-bound memory read
    with random value.

    Let's fix now.

    Fixes: 431339ba9042 ("staging: erofs: add inode operations")
    Cc: <stable@vger.kernel.org> # 4.19+
    Link: https://lore.kernel.org/r/20200729175801.GA23973@xiangao.remote.csb
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
    [ Gao Xiang: resolve non-trivial conflicts for latest 4.19.y. ]
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ee000f1badb6ca558527d2e99e6130e56fe6acfb
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Sun Nov 1 03:51:02 2020 +0800

    erofs: derive atime instead of leaving it empty

    commit d3938ee23e97bfcac2e0eb6b356875da73d700df upstream.

    EROFS has _only one_ ondisk timestamp (ctime is currently
    documented and recorded, we might also record mtime instead
    with a new compat feature if needed) for each extended inode
    since EROFS isn't mainly for archival purposes so no need to
    keep all timestamps on disk especially for Android scenarios
    due to security concerns. Also, romfs/cramfs don't have their
    own on-disk timestamp, and squashfs only records mtime instead.

    Let's also derive access time from ondisk timestamp rather than
    leaving it empty, and if mtime/atime for each file are really
    needed for specific scenarios as well, we can also use xattrs
    to record them then.

    Link: https://lore.kernel.org/r/20201031195102.21221-1-hsiangkao@aol.com
    [ Gao Xiang: It'd be better to backport for user-friendly concern. ]
    Fixes: 431339ba9042 ("staging: erofs: add inode operations")
    Cc: stable <stable@vger.kernel.org> # 4.19+
    Reported-by: nl6720 <nl6720@gmail.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    [ Gao Xiang: Manually backport to 4.19.y due to trivial conflicts. ]
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0601575a0ca46c49aaf765aaba9df8c1ce63cc9a
Author: Gao Xiang <hsiangkao@redhat.com>
Date:   Fri Jun 19 07:43:49 2020 +0800

    erofs: fix partially uninitialized misuse in z_erofs_onlinepage_fixup

    commit 3c597282887fd55181578996dca52ce697d985a5 upstream.

    Hongyu reported "id != index" in z_erofs_onlinepage_fixup() with
    specific aarch64 environment easily, which wasn't shown before.

    After digging into that, I found that high 32 bits of page->private
    was set to 0xaaaaaaaa rather than 0 (due to z_erofs_onlinepage_init
    behavior with specific compiler options). Actually we only use low
    32 bits to keep the page information since page->private is only 4
    bytes on most 32-bit platforms. However z_erofs_onlinepage_fixup()
    uses the upper 32 bits by mistake.

    Let's fix it now.

    Reported-and-tested-by: Hongyu Jin <hongyu.jin@unisoc.com>
    Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
    Cc: <stable@vger.kernel.org> # 4.19+
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Link: https://lore.kernel.org/r/20200618234349.22553-1-hsiangkao@aol.com
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 02cee974cb788dd6b23837c04e347dbadccb7e67
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Feb 26 16:10:06 2020 +0800

    erofs: correct the remaining shrink objects

    commit 9d5a09c6f3b5fb85af20e3a34827b5d27d152b34 upstream.

    The remaining count should not include successful
    shrink attempts.

    Fixes: e7e9a307be9d ("staging: erofs: introduce workstation for decompression")
    Cc: <stable@vger.kernel.org> # 4.19+
    Link: https://lore.kernel.org/r/20200226081008.86348-1-gaoxiang25@huawei.com
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit afe022d9f5721497e63d11d3fdb06c95c6256c23
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Sun Dec 1 16:01:09 2019 +0800

    erofs: zero out when listxattr is called with no xattr

    commit 926d1650176448d7684b991fbe1a5b1a8289e97c upstream.

    As David reported [1], ENODATA returns when attempting
    to modify files by using EROFS as an overlayfs lower layer.

    The root cause is that listxattr could return unexpected
    -ENODATA by mistake for inodes without xattr. That breaks
    listxattr return value convention and it can cause copy
    up failure when used with overlayfs.

    Resolve by zeroing out if no xattr is found for listxattr.

    [1] https://lore.kernel.org/r/CAEvUa7nxnby+rxK-KRMA46=exeOMApkDMAV08AjMkkPnTPV4CQ@mail.gmail.com
    Link: https://lore.kernel.org/r/20191201084040.29275-1-hsiangkao@aol.com
    Fixes: cadf1ccf1b00 ("staging: erofs: add error handling for xattr submodule")
    Cc: <stable@vger.kernel.org> # 4.19+
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fceffbd856369cedfa23b313844d3906de8fd36e
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Oct 9 18:12:39 2019 +0800

    staging: erofs: detect potential multiref due to corrupted images

    commit e12a0ce2fa69798194f3a8628baf6edfbd5c548f upstream.

    As reported by erofs-utils fuzzer, currently, multiref
    (ondisk deduplication) hasn't been supported for now,
    we should forbid it properly.

    Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
    Cc: <stable@vger.kernel.org> # 4.19+
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Link: https://lore.kernel.org/r/20190821140152.229648-1-gaoxiang25@huawei.com
    [ Gao Xiang: Since earlier kernels don't define EFSCORRUPTED,
                 let's use EIO instead. ]
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9b3495631f1dba2feac41c880e564df6e242c8ab
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Oct 9 18:12:38 2019 +0800

    staging: erofs: add two missing erofs_workgroup_put for corrupted images

    commit 138e1a0990e80db486ab9f6c06bd5c01f9a97999 upstream.

    As reported by erofs-utils fuzzer, these error handling
    path will be entered to handle corrupted images.

    Lack of erofs_workgroup_puts will cause unmounting
    unsuccessfully.

    Fix these return values to EFSCORRUPTED as well.

    Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
    Cc: <stable@vger.kernel.org> # 4.19+
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Link: https://lore.kernel.org/r/20190819103426.87579-4-gaoxiang25@huawei.com
    [ Gao Xiang: Older kernel versions don't have length validity check
                 and EFSCORRUPTED, thus backport pageofs check for now. ]
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 20b9eea304f612a2cff8690eebc57d228e45b95e
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Oct 9 18:12:37 2019 +0800

    staging: erofs: some compressed cluster should be submitted for corrupted images

    commit ee45197c807895e156b2be0abcaebdfc116487c8 upstream.

    As reported by erofs_utils fuzzer, a logical page can belong
    to at most 2 compressed clusters, if one compressed cluster
    is corrupted, but the other has been ready in submitting chain.

    The chain needs to submit anyway in order to keep the page
    working properly (page unlocked with PG_error set, PG_uptodate
    not set).

    Let's fix it now.

    Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
    Cc: <stable@vger.kernel.org> # 4.19+
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Link: https://lore.kernel.org/r/20190819103426.87579-2-gaoxiang25@huawei.com
    [ Gao Xiang: Manually backport to v4.19.y stable. ]
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c61556faf792f95db0edbee6646fa2f52c8515d1
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Oct 9 18:12:36 2019 +0800

    staging: erofs: fix an error handling in erofs_readdir()

    commit acb383f1dcb4f1e79b66d4be3a0b6f519a957b0d upstream.

    Richard observed a forever loop of erofs_read_raw_page() [1]
    which can be generated by forcely setting ->u.i_blkaddr
    to 0xdeadbeef (as my understanding block layer can
    handle access beyond end of device correctly).

    After digging into that, it seems the problem is highly
    related with directories and then I found the root cause
    is an improper error handling in erofs_readdir().

    Let's fix it now.

    [1] https://lore.kernel.org/r/1163995781.68824.1566084358245.JavaMail.zimbra@nod.at/

    Reported-by: Richard Weinberger <richard@nod.at>
    Fixes: 3aa8ec716e52 ("staging: erofs: add directory operations")
    Cc: <stable@vger.kernel.org> # 4.19+
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Link: https://lore.kernel.org/r/20190818125457.25906-1-hsiangkao@aol.com
    [ Gao Xiang: Since earlier kernels don't define EFSCORRUPTED,
                 let's use original error code instead. ]
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 44e25b73c4772f5f08d483bbdcfe81c95758e955
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jun 13 16:35:41 2019 +0800

    staging: erofs: add requirements field in superblock

    commit 5efe5137f05bbb4688890620934538c005e7d1d6 upstream.

    There are some backward incompatible features pending
    for months, mainly due to on-disk format expensions.

    However, we should ensure that it cannot be mounted with
    old kernels. Otherwise, it will causes unexpected behaviors.

    Fixes: ba2b77a82022 ("staging: erofs: add super block operations")
    Cc: <stable@vger.kernel.org> # 4.19+
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c458b3206aa217c67af63679c67cda21d1bb63fd
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Fri Mar 29 04:14:58 2019 +0800

    staging: erofs: keep corrupted fs from crashing kernel in erofs_readdir()

    commit 33bac912840fe64dbc15556302537dc6a17cac63 upstream.

    After commit 419d6efc50e9, kernel cannot be crashed in the namei
    path. However, corrupted nameoff can do harm in the process of
    readdir for scenerios without dm-verity as well. Fix it now.

    Fixes: 3aa8ec716e52 ("staging: erofs: add directory operations")
    Cc: <stable@vger.kernel.org> # 4.19+
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 77a2c8cadafb7972b2812c097f518ac3099e8a3b
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Mon Mar 25 11:40:07 2019 +0800

    staging: erofs: fix error handling when failed to read compresssed data

    commit b6391ac73400eff38377a4a7364bd3df5efb5178 upstream.

    Complete read error handling paths for all three kinds of
    compressed pages:

     1) For cache-managed pages, PG_uptodate will be checked since
        read_endio will unlock and SetPageUptodate for these pages;

     2) For inplaced pages, read_endio cannot SetPageUptodate directly
        since it should be used to mark the final decompressed data,
        PG_error will be set with page locked for IO error instead;

     3) For staging pages, PG_error is used, which is similar to
        what we do for inplaced pages.

    Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
    Cc: <stable@vger.kernel.org> # 4.19+
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 74528ff6c38df709674cc676f67e79eac815e23f
Author: Chao Yu <yuchao0@huawei.com>
Date:   Mon Mar 11 23:10:10 2019 +0800

    staging: erofs: fix to handle error path of erofs_vmap()

    commit 8bce6dcede65139a087ff240127e3f3c01363eed upstream.

    erofs_vmap() wrapped vmap() and vm_map_ram() to return virtual
    continuous memory, but both of them can failed due to a lot of
    reason, previously, erofs_vmap()'s callers didn't handle them,
    which can potentially cause NULL pointer access, fix it.

    Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
    Fixes: 0d40d6e399c1 ("staging: erofs: add a generic z_erofs VLE decompressor")
    Cc: <stable@vger.kernel.org> # 4.19+
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 910cd92ee289977f064971f7659cda0228ec1615
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Fri Nov 23 01:16:00 2018 +0800

    staging: erofs: fix race when the managed cache is enabled

    commit 51232df5e4b268936beccde5248f312a316800be upstream.

    When the managed cache is enabled, the last reference count
    of a workgroup must be used for its workstation.

    Otherwise, it could lead to incorrect (un)freezes in
    the reclaim path, and it would be harmful.

    A typical race as follows:

    Thread 1 (In the reclaim path)  Thread 2
    workgroup_freeze(grp, 1)                                refcnt = 1
    ...
    workgroup_unfreeze(grp, 1)                              refcnt = 1
                                    workgroup_get(grp)      refcnt = 2 (x)
    workgroup_put(grp)                                      refcnt = 1 (x)
                                    ...unexpected behaviors

    * grp is detached but still used, which violates cache-managed
      freeze constraint.

    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a906ead6ff3295233d3643d662309cddb7efd896
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Mon Mar 11 14:08:58 2019 +0800

    staging: erofs: keep corrupted fs from crashing kernel in erofs_namei()

    commit 419d6efc50e94bcf5d6b35cd8c71f79edadec564 upstream.

    As Al pointed out, "
    ... and while we are at it, what happens to
    	unsigned int nameoff = le16_to_cpu(de[mid].nameoff);
    	unsigned int matched = min(startprfx, endprfx);

    	struct qstr dname = QSTR_INIT(data + nameoff,
    		unlikely(mid >= ndirents - 1) ?
    			maxsize - nameoff :
    			le16_to_cpu(de[mid + 1].nameoff) - nameoff);

    	/* string comparison without already matched prefix */
    	int ret = dirnamecmp(name, &dname, &matched);
    if le16_to_cpu(de[...].nameoff) is not monotonically increasing?  I.e.
    what's to prevent e.g. (unsigned)-1 ending up in dname.len?

    Corrupted fs image shouldn't oops the kernel.. "

    Revisit the related lookup flow to address the issue.

    Fixes: d72d1ce60174 ("staging: erofs: add namei functions")
    Cc: <stable@vger.kernel.org> # 4.19+
    Suggested-by: Al Viro <viro@ZenIV.linux.org.uk>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6dbf1a15dcd2f0097d819daa4ee1926b2345d02f
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Mon Mar 11 14:08:57 2019 +0800

    staging: erofs: fix race of initializing xattrs of a inode at the same time

    commit 62dc45979f3f8cb0ea67302a93bff686f0c46c5a upstream.

    In real scenario, there could be several threads accessing xattrs
    of the same xattr-uninitialized inode, and init_inode_xattrs()
    almost at the same time.

    That's actually an unexpected behavior, this patch closes the race.

    Fixes: b17500a0fdba ("staging: erofs: introduce xattr & acl support")
    Cc: <stable@vger.kernel.org> # 4.19+
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 044ba07158562ecf1b2e9079fa97c9980b523eb0
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Mon Mar 11 14:08:56 2019 +0800

    staging: erofs: fix memleak of inode's shared xattr array

    From: Sheng Yong <shengyong1@huawei.com>

    commit 3b1b5291f79d040d549d7c746669fc30e8045b9b upstream.

    If it fails to read a shared xattr page, the inode's shared xattr array
    is not freed. The next time the inode's xattr is accessed, the previously
    allocated array is leaked.

    Signed-off-by: Sheng Yong <shengyong1@huawei.com>
    Fixes: b17500a0fdba ("staging: erofs: introduce xattr & acl support")
    Cc: <stable@vger.kernel.org> # 4.19+
    Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 240517d98c12632095f2848bd94c30debdcaf600
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Mon Mar 11 14:08:55 2019 +0800

    staging: erofs: fix fast symlink w/o xattr when fs xattr is on

    commit 7077fffcb0b0b65dc75e341306aeef4d0e7f2ec6 upstream.

    Currently, this will hit a BUG_ON for these symlinks as follows:

    - kernel message
    ------------[ cut here ]------------
    kernel BUG at drivers/staging/erofs/xattr.c:59!
    SMP PTI
    CPU: 1 PID: 1170 Comm: getllxattr Not tainted 4.20.0-rc6+ #92
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014
    RIP: 0010:init_inode_xattrs+0x22b/0x270
    Code: 48 0f 45 ea f0 ff 4d 34 74 0d 41 83 4c 24 e0 01 31 c0 e9 00 fe ff ff 48 89 ef e8 e0 31 9e ff eb e9 89 e8 e9 ef fd ff ff 0f 0$
     <0f> 0b 48 89 ef e8 fb f6 9c ff 48 8b 45 08 a8 01 75 24 f0 ff 4d 34
    RSP: 0018:ffffa03ac026bdf8 EFLAGS: 00010246
    ------------[ cut here ]------------
    ...
    Call Trace:
     erofs_listxattr+0x30/0x2c0
     ? selinux_inode_listxattr+0x5a/0x80
     ? kmem_cache_alloc+0x33/0x170
     ? security_inode_listxattr+0x27/0x40
     listxattr+0xaf/0xc0
     path_listxattr+0x5a/0xa0
     do_syscall_64+0x43/0xf0
     entry_SYSCALL_64_after_hwframe+0x44/0xa9
    ...
    ---[ end trace 3c24b49408dc0c72 ]---

    Fix it by checking ->xattr_isize in init_inode_xattrs(),
    and it also fixes improper return value -ENOTSUPP
    (it should be -ENODATA if xattr is enabled) for those inodes.

    Fixes: b17500a0fdba ("staging: erofs: introduce xattr & acl support")
    Cc: <stable@vger.kernel.org> # 4.19+
    Reported-by: Li Guifu <bluce.liguifu@huawei.com>
    Tested-by: Li Guifu <bluce.liguifu@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 78544513d768a1559d7e61d5e29270844db027d2
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Mon Mar 11 14:08:54 2019 +0800

    staging: erofs: add error handling for xattr submodule

    commit cadf1ccf1b0021d0b7a9347e102ac5258f9f98c8 upstream.

    This patch enhances the missing error handling code for
    xattr submodule, which improves the stability for the rare cases.

    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f1f405af62a3f3b37bf965ddbc3ef5aa2fab2f57
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Feb 27 13:33:30 2019 +0800

    staging: erofs: compressed_pages should not be accessed again after freed

    commit af692e117cb8cd9d3d844d413095775abc1217f9 upstream.

    This patch resolves the following page use-after-free issue,
    z_erofs_vle_unzip:
        ...
        for (i = 0; i < nr_pages; ++i) {
            ...
            z_erofs_onlinepage_endio(page);  (1)
        }

        for (i = 0; i < clusterpages; ++i) {
            page = compressed_pages[i];

            if (page->mapping == mngda)      (2)
                continue;
            /* recycle all individual staging pages */
            (void)z_erofs_gather_if_stagingpage(page_pool, page); (3)
            WRITE_ONCE(compressed_pages[i], NULL);
        }
        ...

    After (1) is executed, page is freed and could be then reused, if
    compressed_pages is scanned after that, it could fall info (2) or
    (3) by mistake and that could finally be in a mess.

    This patch aims to solve the above issue only with little changes
    as much as possible in order to make the fix backport easier.

    Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
    Cc: <stable@vger.kernel.org> # 4.19+
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b3a98208a957c0e05850b82ebf7f474ab295ff00
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Feb 27 13:33:31 2019 +0800

    staging: erofs: fix illegal address access under memory pressure

    commit 1e5ceeab6929585512c63d05911d6657064abf7b upstream.

    Considering a read request with two decompressed file pages,
    If a decompression work cannot be started on the previous page
    due to memory pressure but in-memory LTP map lookup is done,
    builder->work should be still NULL.

    Moreover, if the current page also belongs to the same map,
    it won't try to start the decompression work again and then
    run into trouble.

    This patch aims to solve the above issue only with little changes
    as much as possible in order to make the fix backport easier.

    kernel message is:
    <4>[1051408.015930s]SLUB: Unable to allocate memory on node -1, gfp=0x2408040(GFP_NOFS|__GFP_ZERO)
    <4>[1051408.015930s]  cache: erofs_compress, object size: 144, buffer size: 144, default order: 0, min order: 0
    <4>[1051408.015930s]  node 0: slabs: 98, objs: 2744, free: 0
      * Cannot allocate the decompression work

    <3>[1051408.015960s]erofs: z_erofs_vle_normalaccess_readpages, readahead error at page 1008 of nid 5391488
      * Note that the previous page was failed to read

    <0>[1051408.015960s]Internal error: Accessing user space memory outside uaccess.h routines: 96000005 [#1] PREEMPT SMP
    ...
    <4>[1051408.015991s]Hardware name: kirin710 (DT)
    ...
    <4>[1051408.016021s]PC is at z_erofs_vle_work_add_page+0xa0/0x17c
    <4>[1051408.016021s]LR is at z_erofs_do_read_page+0x12c/0xcf0
    ...
    <4>[1051408.018096s][<ffffff80c6fb0fd4>] z_erofs_vle_work_add_page+0xa0/0x17c
    <4>[1051408.018096s][<ffffff80c6fb3814>] z_erofs_vle_normalaccess_readpages+0x1a0/0x37c
    <4>[1051408.018096s][<ffffff80c6d670b8>] read_pages+0x70/0x190
    <4>[1051408.018127s][<ffffff80c6d6736c>] __do_page_cache_readahead+0x194/0x1a8
    <4>[1051408.018127s][<ffffff80c6d59318>] filemap_fault+0x398/0x684
    <4>[1051408.018127s][<ffffff80c6d8a9e0>] __do_fault+0x8c/0x138
    <4>[1051408.018127s][<ffffff80c6d8f90c>] handle_pte_fault+0x730/0xb7c
    <4>[1051408.018127s][<ffffff80c6d8fe04>] __handle_mm_fault+0xac/0xf4
    <4>[1051408.018157s][<ffffff80c6d8fec8>] handle_mm_fault+0x7c/0x118
    <4>[1051408.018157s][<ffffff80c8c52998>] do_page_fault+0x354/0x474
    <4>[1051408.018157s][<ffffff80c8c52af8>] do_translation_fault+0x40/0x48
    <4>[1051408.018157s][<ffffff80c6c002f4>] do_mem_abort+0x80/0x100
    <4>[1051408.018310s]---[ end trace 9f4009a3283bd78b ]---

    Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
    Cc: <stable@vger.kernel.org> # 4.19+
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 14b20a49fc73c4818efa3327451904ef6f9c07ab
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Feb 27 13:33:32 2019 +0800

    staging: erofs: fix mis-acted TAIL merging behavior

    commit a112152f6f3a2a88caa6f414d540bd49e406af60 upstream.

    EROFS has an optimized path called TAIL merging, which is designed
    to merge multiple reads and the corresponding decompressions into
    one if these requests read continuous pages almost at the same time.

    In general, it behaves as follows:
     ________________________________________________________________
      ... |  TAIL  .  HEAD  |  PAGE  |  PAGE  |  TAIL    . HEAD | ...
     _____|_combined page A_|________|________|_combined page B_|____
            1  ]  ->  [  2                          ]  ->  [ 3
    If the above three reads are requested in the order 1-2-3, it will
    generate a large work chain rather than 3 individual work chains
    to reduce scheduling overhead and boost up sequential read.

    However, if Read 2 is processed slightly earlier than Read 1,
    currently it still generates 2 individual work chains (chain 1, 2)
    but it does in-place decompression for combined page A, moreover,
    if chain 2 decompresses ahead of chain 1, it will be a race and
    lead to corrupted decompressed page. This patch fixes it.

    Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
    Cc: <stable@vger.kernel.org> # 4.19+
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1931a6c5fe28edd9c62d54dd67806c3806e9cdb7
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Tue Dec 11 15:17:50 2018 +0800

    staging: erofs: unzip_vle_lz4.c,utils.c: rectify BUG_ONs

    commit b8e076a6ef253e763bfdb81e5c72bcc828b0fbeb upstream.

    remove all redundant BUG_ONs, and turn the rest
    useful usages to DBG_BUGONs.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0773d1966061cba2de6b226947470baf88feda72
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Tue Dec 11 15:17:49 2018 +0800

    staging: erofs: unzip_{pagevec.h,vle.c}: rectify BUG_ONs

    commit 70b17991d89554cdd16f3e4fb0179bcc03c808d9 upstream.

    remove all redundant BUG_ONs, and turn the rest
    useful usages to DBG_BUGONs.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6a00c9d7066562e418e30b1b211c77aed5c40551
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Dec 5 21:23:13 2018 +0800

    staging: erofs: {dir,inode,super}.c: rectify BUG_ONs

    commit 8b987bca2d09649683cbe496419a011df8c08493 upstream.

    remove all redundant BUG_ONs, and turn the rest
    useful usages to DBG_BUGONs.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ef609890e1f8f27546f25d058bcaeb3c5a7a982f
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Fri Nov 23 01:16:03 2018 +0800

    staging: erofs: add a full barrier in erofs_workgroup_unfreeze

    commit 948bbdb1818b7ad6e539dad4fbd2dd4650793ea9 upstream.

    Just like other generic locks, insert a full barrier
    in case of memory reorder.

    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e88d7d9adb52d0f9ba8028c6b4a13e7e83d743a5
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Fri Nov 23 01:16:02 2018 +0800

    staging: erofs: fix `erofs_workgroup_{try_to_freeze, unfreeze}'

    commit 73f5c66df3e26ab750cefcb9a3e08c71c9f79cad upstream.

    There are two minor issues in the current freeze interface:

       1) Freeze interfaces have not related with CONFIG_DEBUG_SPINLOCK,
          therefore fix the incorrect conditions;

       2) For SMP platforms, it should also disable preemption before
          doing atomic_cmpxchg in case that some high priority tasks
          preempt between atomic_cmpxchg and disable_preempt, then spin
          on the locked refcount later.

    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 26b9413853f64a44d858c24bc2b4c834a2e6a1fc
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Fri Nov 23 01:16:01 2018 +0800

    staging: erofs: atomic_cond_read_relaxed on ref-locked workgroup

    commit df134b8d17b90c1e7720e318d36416b57424ff7a upstream.

    It's better to use atomic_cond_read_relaxed, which is implemented
    in hardware instructions to monitor a variable changes currently
    for ARM64, instead of open-coded busy waiting.

    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 28e3fa73e294002f8e7c48b6e9ea92784bf9e21a
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Sat Nov 3 17:23:56 2018 +0800

    staging: erofs: remove the redundant d_rehash() for the root dentry

    commit e9c892465583c8f42d61fafe30970d36580925df upstream.

    There is actually no need at all to d_rehash() for the root dentry
    as Al pointed out, fix it.

    Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
    Cc: Al Viro <viro@ZenIV.linux.org.uk>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e3e7bbe526acfac4307a2a6d7e2aaf5222ea88de
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Sep 19 13:49:07 2018 +0800

    staging: erofs: drop multiref support temporarily

    commit e5e3abbadf0dbd1068f64f8abe70401c5a178180 upstream.

    Multiref support means that a compressed page could have
    more than one reference, which is designed for on-disk data
    deduplication. However, mkfs doesn't support this mode
    at this moment, and the kernel implementation is also broken.

    Let's drop multiref support. If it is fully implemented
    in the future, it can be reverted later.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2dd8bd1abced431fa4be477299fa9ddce4677642
Author: Chen Gong <gongchen4@huawei.com>
Date:   Tue Sep 18 22:27:28 2018 +0800

    staging: erofs: replace BUG_ON with DBG_BUGON in data.c

    commit 9141b60cf6a53c99f8a9309bf8e1c6650a6785c1 upstream.

    This patch replace BUG_ON with DBG_BUGON in data.c, and add necessary
    error handler.

    Signed-off-by: Chen Gong <gongchen4@huawei.com>
    Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a14a5cf712938fadd39fb99a8f8a46d72b19cd4d
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Tue Sep 18 22:27:25 2018 +0800

    staging: erofs: complete error handing of z_erofs_do_read_page

    commit 1e05ff36e6921ca61bdbf779f81a602863569ee3 upstream.

    This patch completes error handing code of z_erofs_do_read_page.
    PG_error will be set when some read error happens, therefore
    z_erofs_onlinepage_endio will unlock this page without setting
    PG_uptodate.

    Reviewed-by: Chao Yu <yucxhao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 381d39d1c2d471e4c318320bae60806c5d0b04bd
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Tue Sep 18 22:25:36 2018 +0800

    staging: erofs: fix a bug when appling cache strategy

    commit 0734ffbf574ee813b20899caef2fe0ed502bb783 upstream.

    As described in Kconfig, the last compressed pack should be cached
    for further reading for either `EROFS_FS_ZIP_CACHE_UNIPOLAR' or
    `EROFS_FS_ZIP_CACHE_BIPOLAR' by design.

    However, there is a bug in z_erofs_do_read_page, it will
    switch `initial' to `false' at the very beginning before it decides
    to cache the last compressed pack.

    caching strategy should work properly after appling this patch.

    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3dc0616d60bcc3888f5dcf4585bcc5e2131a64df
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Fri Nov 23 01:15:59 2018 +0800

    staging: erofs: fix the definition of DBG_BUGON

    [ Upstream commit eef168789866514e5d4316f030131c9fe65b643f ]

    It's better not to positively BUG_ON the kernel, however developers
    need a way to locate issues as soon as possible.

    DBG_BUGON is introduced and it could only crash when EROFS_FS_DEBUG
    (EROFS developping feature) is on. It is helpful for developers
    to find and solve bugs quickly by eng builds.

    Previously, DBG_BUGON is defined as ((void)0) if EROFS_FS_DEBUG is off,
    but some unused variable warnings as follows could occur:

    drivers/staging/erofs/unzip_vle.c: In function `init_alway:':
    drivers/staging/erofs/unzip_vle.c:61:33: warning: unused variable `work' [-Wunused-variable]
      struct z_erofs_vle_work *const work =
                                     ^~~~

    Fix it to #define DBG_BUGON(x) ((void)(x)).

    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 92c97ef11b111b764dc92c5edaf9385f74c72e7d
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Sat Dec 8 00:19:12 2018 +0800

    staging: erofs: fix use-after-free of on-stack `z_erofs_vle_unzip_io'

    [ Upstream commit 848bd9acdcd00c164b42b14aacec242949ecd471 ]

    The root cause is the race as follows:
     Thread #0                         Thread #1

     z_erofs_vle_unzip_kickoff         z_erofs_submit_and_unzip

                                        struct z_erofs_vle_unzip_io io[]
       atomic_add_return()
                                        wait_event()
                                        [end of function]
       wake_up()

    Fix it by taking the waitqueue lock between atomic_add_return and
    wake_up to close such the race.

    kernel message:

    Unable to handle kernel paging request at virtual address 97f7052caa1303dc
    ...
    Workqueue: kverityd verity_work
    task: ffffffe32bcb8000 task.stack: ffffffe3298a0000
    PC is at __wake_up_common+0x48/0xa8
    LR is at __wake_up+0x3c/0x58
    ...
    Call trace:
    ...
    [<ffffff94a08ff648>] __wake_up_common+0x48/0xa8
    [<ffffff94a08ff8b8>] __wake_up+0x3c/0x58
    [<ffffff94a0c11b60>] z_erofs_vle_unzip_kickoff+0x40/0x64
    [<ffffff94a0c118e4>] z_erofs_vle_read_endio+0x94/0x134
    [<ffffff94a0c83c9c>] bio_endio+0xe4/0xf8
    [<ffffff94a1076540>] dec_pending+0x134/0x32c
    [<ffffff94a1076f28>] clone_endio+0x90/0xf4
    [<ffffff94a0c83c9c>] bio_endio+0xe4/0xf8
    [<ffffff94a1095024>] verity_work+0x210/0x368
    [<ffffff94a08c4150>] process_one_work+0x188/0x4b4
    [<ffffff94a08c45bc>] worker_thread+0x140/0x458
    [<ffffff94a08cad48>] kthread+0xec/0x108
    [<ffffff94a0883ab4>] ret_from_fork+0x10/0x1c
    Code: d1006273 54000260 f9400804 b9400019 (b85fc081)
    ---[ end trace be9dde154f677cd1 ]---

    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    Signed-off-by: Sasha Levin <sashal@kernel.org>

commit 323056dc5fbe4768311194a3a2adf14806f25074
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Tue Sep 18 22:25:33 2018 +0800

    staging: erofs: fix a missing endian conversion

    [ Upstream commit 37ec35a6cc2b99eb7fd6b85b7d7b75dff46bc353 ]

    This patch fixes a missing endian conversion in
    vle_get_logical_extent_head.

    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 69f2b4eaba237770f5c696942595d064ae3340f8
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Sep 6 17:01:47 2018 +0800

    staging: erofs: rename superblock flags (MS_xyz -> SB_xyz)

    This patch follows commit 1751e8a6cb93 ("Rename superblock
    flags (MS_xyz -> SB_xyz)") and after commit ("vfs: Suppress
    MS_* flag defs within the kernel unless explicitly enabled"),
    there is no MS_RDONLY and MS_NOATIME at all.

    Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: David Howells <dhowells@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1621b077d53285bd5127532ce160cec69adbe660
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Tue Aug 28 11:39:48 2018 +0800

    Revert "staging: erofs: disable compiling temporarile"

    This reverts commit 156c3df8d4db4e693c062978186f44079413d74d.

    Since XArray and the new mount apis aren't merged in 4.19-rc1
    merge window, the BROKEN mark can be reverted directly without
    any problems.

    Fixes: 156c3df8d4db ("staging: erofs: disable compiling temporarile")
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: David Howells <dhowells@redhat.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3bbdccddb4ee53c0b81545226439f231ae698f65
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Mon Aug 6 11:27:53 2018 +0800

    staging: erofs: remove an extra semicolon in z_erofs_vle_unzip_all

    There is an extra semicolon in z_erofs_vle_unzip_all, remove it.

    Reported-by: Julia Lawall <julia.lawall@lip6.fr>
    Signed-off-by: zhong jiang <zhongjiang@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ee25ad8cd5b803ae4cda0116304ff15383cb6881
Author: Kristaps Čivkulis <kristaps.civkulis@gmail.com>
Date:   Sun Aug 5 18:21:01 2018 +0300

    staging: erofs: fix if assignment style issue

    Fix coding style issue "do not use assignment in if condition"
    detected by checkpatch.pl.

    Signed-off-by: Kristaps Čivkulis <kristaps.civkulis@gmail.com>
    Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 81d71d6e9a330f4471f3edec412d6124031eac46
Author: Chao Yu <yuchao0@huawei.com>
Date:   Thu Aug 2 17:39:17 2018 +0800

    staging: erofs: disable compiling temporarile

    As Stephen Rothwell reported:

    "After merging the staging tree, today's linux-next build (x86_64
    allmodconfig) failed like this:

    drivers/staging/erofs/super.c: In function 'erofs_read_super':
    drivers/staging/erofs/super.c:343:17: error: 'MS_RDONLY' undeclared (first use in this function); did you mean 'IS_RDONLY'?
      sb->s_flags |= MS_RDONLY | MS_NOATIME;
                     ^~~~~~~~~
                     IS_RDONLY
    drivers/staging/erofs/super.c:343:17: note: each undeclared identifier is reported only once for each function it appears in
    drivers/staging/erofs/super.c:343:29: error: 'MS_NOATIME' undeclared (first use in this function); did you mean 'S_NOATIME'?
      sb->s_flags |= MS_RDONLY | MS_NOATIME;
                                 ^~~~~~~~~~
                                 S_NOATIME
    drivers/staging/erofs/super.c: In function 'erofs_mount':
    drivers/staging/erofs/super.c:501:10: warning: passing argument 5 of 'mount_bdev' makes integer from pointer without a cast [-Wint-conversion]
       &priv, erofs_fill_super);
              ^~~~~~~~~~~~~~~~
    In file included from include/linux/buffer_head.h:12:0,
                     from drivers/staging/erofs/super.c:14:
    include/linux/fs.h:2151:23: note: expected 'size_t {aka long unsigned int}' but argument is of type 'int (*)(struct super_block *, void *, int)'
     extern struct dentry *mount_bdev(struct file_system_type *fs_type,
                           ^~~~~~~~~~
    drivers/staging/erofs/super.c:500:9: error: too few arguments to function 'mount_bdev'
      return mount_bdev(fs_type, flags, dev_name,
             ^~~~~~~~~~
    In file included from include/linux/buffer_head.h:12:0,
                     from drivers/staging/erofs/super.c:14:
    include/linux/fs.h:2151:23: note: declared here
     extern struct dentry *mount_bdev(struct file_system_type *fs_type,
                           ^~~~~~~~~~
    drivers/staging/erofs/super.c: At top level:
    drivers/staging/erofs/super.c:518:20: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
      .mount          = erofs_mount,
                        ^~~~~~~~~~~
    drivers/staging/erofs/super.c:518:20: note: (near initialization for 'erofs_fs_type.mount')
    drivers/staging/erofs/super.c: In function 'erofs_remount':
    drivers/staging/erofs/super.c:630:12: error: 'MS_RDONLY' undeclared (first use in this function); did you mean 'IS_RDONLY'?
      *flags |= MS_RDONLY;
                ^~~~~~~~~
                IS_RDONLY
    drivers/staging/erofs/super.c: At top level:
    drivers/staging/erofs/super.c:640:16: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
      .remount_fs = erofs_remount,
                    ^~~~~~~~~~~~~

    Caused by various commits creating erofs in the staging tree interacting
    with various commits redoing the mount infrastructure in the vfs tree.

    I have disabed CONFIG_EROFS_FS for now:"

    The reason of compiling error is:

    Since -next collects and merges developing patches including common vfs
    stuff from multi-trees, but those patches didn't cover erofs, such as:

    ('vfs: Suppress MS_* flag defs within the kernel unless explicitly enabled")
    https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=for-next&id=109b45090d7d3ce2797bb1ef7f70eead5bfe0ff3

    ("vfs: Require specification of size of mount data for internal mounts")
    https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=for-next&id=0a191e4505a4f255e6513b49426213da69bf0e80

    Above vfs related patches has not been merged in staging tree, if we
    submit those erofs patches to staging mailing list and after including
    them in staging-{test,nexts} tree, it can easily cause compiling error.

    We worked out some patches to adjust those vfs change, but now we just
    submit them to -next tree temporarily to avoid compiling error.

    For potentail conflict in between erofs and vfs changes in incoming
    merge window, Stephen suggested that we can disable CONFIG_EROFS_FS
    temporarily to pass merge window, and after that we can do restore by
    reenabling CONFIG_EROFS_FS and applying those fixing patches. Also
    Greg confirmed this solution.

    So, let's disable compiling erofs for a while.

    Suggested-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2d4499c8b8b78dd00788a7513373d0900013e850
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Aug 1 14:38:31 2018 +0800

    staging: erofs: remove a redundant marco in xattr

    There is no need to '#if CONFIG_EROFS_FS_XATTR' in xattr.c,
    let's remove it.

    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8eaefd9be86fa3d85305f05192568ba1507dab75
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Wed Aug 1 17:36:54 2018 +0800

    staging: erofs: add the missing break in z_erofs_map_blocks_iter

    This patch adds a missing break after adding the default case.

    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b79d82f61f25e532b98f7d3a3d49b250f1728e0d
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Mon Jul 30 09:51:01 2018 +0800

    staging: erofs: use the wrapped PTR_ERR_OR_ZERO instead of open code

    Just clean up and logic doesn't change.

    Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050766.html
    Fixes: d72d1ce60174 ("staging: erofs: add namei functions")
    Reported-by: kbuild test robot <lkp@intel.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ef38dd74d8389a7474b0f947185f347e24419686
Author: Gao Xiang <hsiangkao@aol.com>
Date:   Sun Jul 29 13:37:57 2018 +0800

    staging: erofs: fix conditional uninitialized `pcn' in z_erofs_map_blocks_iter

    This patch adds error handling code for
    z_erofs_map_blocks_iter to fix the compiler blame.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 294e8e93272dcbdabdd6e033e4d14bbfe6d91bb7
Author: Gao Xiang <hsiangkao@aol.com>
Date:   Sun Jul 29 13:34:58 2018 +0800

    staging: erofs: fix compile error without built-in decompression support

    This patch fixes incorrect code snippets due to spilt code
    into small patches by mistake.

    Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050747.html
    Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050750.html
    Reported-by: kbuild test robot <lkp@intel.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit db6fedf04cecf5fa3d78a941fd068d581813dfa0
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Sat Jul 28 15:10:32 2018 +0800

    staging: erofs: fix a compile warning of Z_EROFS_VLE_VMAP_ONSTACK_PAGES

    There is a type mismatch in the definition of
    Z_EROFS_VLE_VMAP_ONSTACK_PAGES, let's fix it.

    Link: https://lists.01.org/pipermail/kbuild-all/2018-July/050707.html
    Reported-by: kbuild test robot <lkp@intel.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 73c620c52e51ff2bf93cf02509cdbd9da3d50220
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:22:08 2018 +0800

    staging: erofs: add a TODO and update MAINTAINERS for staging

    This patch adds a TODO to list the things to be done, and
    the relevant info to MAINTAINERS so we can take all the blame :)

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fd66e0b7e7510165f9c2214a0e68d7025f8b8d83
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:22:07 2018 +0800

    staging: erofs: introduce cached decompression

    This patch adds an optional choice which can be
    enabled by users in order to cache both incomplete
    ends of compressed clusters as a complement to
    the in-place decompression in order to boost random
    read, but it costs more memory than the in-place
    decompression only.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e84127077ff509f7204888244cf848bf9cddd794
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:22:06 2018 +0800

    staging: erofs: introduce VLE decompression support

    This patch introduces the basic in-place VLE decompression
    implementation for the erofs file system.

    Compared with fixed-sized input compression, it implements
    what we call 'the variable-length extent compression' which
    specifies the same output size for each compression block
    to make the full use of IO bandwidth (which means almost
    all data from block device can be directly used for decomp-
    ression), improve the real (rather than just via data caching,
    which costs more memory) random read and keep the relatively
    lower compression ratios (it saves more storage space than
    fixed-sized input compression which is also configured with
    the same input block size), as illustrated below:

            |---  variable-length extent ---|------ VLE ------|---  VLE ---|
             /> clusterofs                  /> clusterofs     /> clusterofs /> clusterofs
       ++---|-------++-----------++---------|-++-----------++-|---------++-|
    ...||   |       ||           ||         | ||           || |         || | ... original data
       ++---|-------++-----------++---------|-++-----------++-|---------++-|
       ++->cluster<-++->cluster<-++->cluster<-++->cluster<-++->cluster<-++
            size         size         size         size         size
             \                             /                 /            /
              \                      /              /            /
               \               /            /            /
                ++-----------++-----------++-----------++
            ... ||           ||           ||           || ... compressed clusters
                ++-----------++-----------++-----------++
                ++->cluster<-++->cluster<-++->cluster<-++
                     size         size         size

    The main point of 'in-place' refers to the decompression mode:
    Instead of allocating independent compressed pages and data
    structures, it reuses the allocated file cache pages at most
    to store its compressed data and the corresponding pagevec in
    a time-sharing approach by default, which will be useful for
    low memory scenario.

    In the end, unlike the other filesystems with (de)compression
    support using a relatively large compression block size, which
    reads and decompresses >= 128KB at once, and gains a more
    good-looking random read (In fact it collects small random reads
    into large sequential reads and caches all decompressed data
    in memory, but it is unacceptable especially for embedded devices
    with limited memory, and it is not the real random read), we
    select a universal small-sized 4KB compressed cluster, which is
    the smallest page size for most architectures, and all compressed
    clusters can be read and decompressed independently, which ensures
    random read number for all use cases.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ab43173ff3316c0120f9b2c3abc325a18773f30f
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:22:05 2018 +0800

    staging: erofs: introduce workstation for decompression

    This patch introduces another concept used by the unzip
    subsystem called 'workstation'. It can be seen as a sparse
    array that stores pointers pointed to data structures
    related to the corresponding physical blocks.

    All lookup cases are protected by RCU read lock. Besides,
    reference count and spin_lock are also introduced to
    manage its lifetime and serialize all update operations.

    'workstation' is currently implemented on the in-kernel
    radix tree approach for backward compatibility.
    With the evolution of linux kernel, it could be migrated
    into XArray implementation in the future.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 84c882ba349e57fa654b0a52d6529bff5c18c0e0
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:22:04 2018 +0800

    staging: erofs: introduce erofs shrinker

    This patch adds a dedicated shrinker targeting to free unneeded
    memory consumed by a number of erofs in-memory data structures.

    Like F2FS and UBIFS, it also adds:
      - sbi->umount_mutex to avoid races on shrinker and put_super
      - sbi->shrinker_run_no to not revisit recently scaned objects

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit dc98494e64df2c56c3d6658f60a86b257e9735a3
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:22:03 2018 +0800

    staging: erofs: introduce superblock registration

    In order to introducing shrinker solution for erofs,
    let's manage all mounted erofs instances at first.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8ded5dd185d595bc3664cabc5de54b84021d3314
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:22:02 2018 +0800

    staging: erofs: add a generic z_erofs VLE decompressor

    Currently, this patch only simply implements LZ4
    decompressor due to its development priority.

    In the future, erofs will support more compression
    algorithm and format other than LZ4, thus a generic
    decompressor interface will be needed.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6406d5e0a4a3a6e88c6898268c36e421d1c5006b
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:22:01 2018 +0800

    staging: erofs: introduce a customized LZ4 decompression

    We have to reduce the memory cost as much as possible,
    so we don't want to decompress more data beyond
    the output buffer size, however "LZ4_decompress_safe_partial"
    doesn't guarantee to stop at the arbitary end position,
    but stop just after its current LZ4 "sequence" is completed.

    Link: https://groups.google.com/forum/#!topic/lz4c/_3kkz5N6n00

    Therefore, I hacked the LZ4 decompression logic by hand,
    probably NOT the fastest approach, and hope for better
    implementation.

    Signed-off-by: Miao Xie <miaoxie@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c21aeb7e5feca41005feac999d4cf446dc65a701
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:22:00 2018 +0800

    staging: erofs: globalize prepare_bio and __submit_bio

    The unzip subsystem also uses these functions,
    let's export them to internal.h.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a5908581d539ef37d1d390e3ad647216440c0ace
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:59 2018 +0800

    staging: erofs: add erofs_allocpage

    This patch introduces an temporary _on-stack_ page
    pool to reuse the freed page directly as much as
    it can for better performance and release all pages
    at a time, it also slightly reduces the possibility of
    the potential memory allocation failure.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bbd3e12ab2521a7c982ac0707bf8da7a0d22653b
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:58 2018 +0800

    staging: erofs: add erofs_map_blocks_iter

    This patch introduces an iterable L2P mapping
    operation 'erofs_map_blocks_iter'.
    Compared with 'erofs_map_blocks', it avoids
    a number of redundant 'release and regrab'
    processes if they request the same meta page.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 70622cae335b9140e4358d7084c10cfb3da3301c
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:57 2018 +0800

    staging: erofs: introduce pagevec for unzip subsystem

    For each compressed cluster, there is a straight-forward
    way of allocating a fixed or variable-sized (for VLE) array
    to record the corresponding file pages for its decompression
    if we decide to decompress these pages asynchronously (eg.
    read-ahead case), however it could take much extra on-heap
    memory compared with traditional uncompressed filesystems.

    This patch introduces a pagevec solution to reuse some
    allocated file page in the time-sharing approach storing
    parts of the array itself in order to minimize the extra
    memory overhead, thus only a constant and small-sized array
    used for booting the whole array itself up will be needed.

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ff29dac3b4b402729a0b75b8724793158701b1f5
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:56 2018 +0800

    staging: erofs: <linux/tagptr.h>: introduce tagged pointer

    Currently kernel has scattered tagged pointer usages hacked
    by hand in plain code, without a unique and portable functionset
    to highlight the tagged pointer itself and wrap these hacked code
    in order to clean up all over meaningless magic masks.

    Therefore, this patch introduces simple generic methods to fold
    tags into a pointer integer. It currently supports the last n bits
    of the pointer for tags, which can be selected by users.

    In addition, it will also be used for the upcoming EROFS filesystem,
    which heavily uses tagged pointer approach for high performance
    and reducing extra memory allocation.

    Link: https://en.wikipedia.org/wiki/Tagged_pointer

    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 153f5ad87b67c45b453790ce206ced7c6cc62609
Author: Chao Yu <yuchao0@huawei.com>
Date:   Thu Jul 26 20:21:55 2018 +0800

    staging: erofs: support tracepoint

    Add basic tracepoints for ->readpage{,s}, ->lookup,
    ->destroy_inode, fill_inode and map_blocks.

    Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 98dd1e3a3f42df26003ae86fd1767b03bef433a6
Author: Chao Yu <yuchao0@huawei.com>
Date:   Thu Jul 26 20:21:54 2018 +0800

    staging: erofs: introduce error injection infrastructure

    This patch introduces error injection infrastructure, with it, we can
    inject error in any kernel exported common functions which erofs used,
    so that it can force erofs running into error paths, it turns out that
    tests can cover real rare paths more easily to find bugs.

    Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 220c7448cdc4c38e5177777de23793e653969904
Author: Chao Yu <yuchao0@huawei.com>
Date:   Thu Jul 26 20:21:53 2018 +0800

    staging: erofs: support special inode

    This patch adds to support special inode, such as block dev, char,
    socket, pipe inode.

    Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7ed68385c49ac127e5baa07220d37cbf937e89d9
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:52 2018 +0800

    staging: erofs: introduce xattr & acl support

    This implements xattr and acl functionalities.

    Inline and shared xattrs are introduced for flexibility.
    Specifically, if the same xattr occurs for many times
    in a large number of inodes or the value of a xattr is so large
    that it isn't suitable to be inlined, a shared xattr
    kept in the xattr meta will be used instead.

    Signed-off-by: Miao Xie <miaoxie@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit db9bea5cf638b0683376b4118754dad0d444dd7c
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:51 2018 +0800

    staging: erofs: update Kconfig and Makefile

    This commit adds Makefile and Kconfig for erofs, and
    updates Makefile and Kconfig files in the fs directory.

    Signed-off-by: Miao Xie <miaoxie@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit afad040452afed7d552fb853c8613c6002e17ccb
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:50 2018 +0800

    staging: erofs: add namei functions

    This commit adds functions that transfer names to inodes.

    Signed-off-by: Miao Xie <miaoxie@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4e7097e1a4a0170e8e51866a1242cc9556dcca5d
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:49 2018 +0800

    staging: erofs: add directory operations

    This adds functions for directory, mainly readdir.

    Signed-off-by: Miao Xie <miaoxie@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 421bfd9b50b8051aa451be073f6387bc678cccab
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:48 2018 +0800

    staging: erofs: add inode operations

    This adds core functions to get, read an inode.

    Signed-off-by: Miao Xie <miaoxie@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 944a5ab5bd4fc480e4099c8e5e97a6dca490a239
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:47 2018 +0800

    staging: erofs: add raw address_space operations

    This commit adds functions for meta and raw data, and also
    provides address_space_operations for raw data access.

    Signed-off-by: Miao Xie <miaoxie@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8305bea76c9178ce211e5759061d10effbba958e
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:46 2018 +0800

    staging: erofs: add super block operations

    This commit adds erofs super block operations, including (u)mount,
    remount_fs, show_options, statfs, in addition to some private
    icache management functions.

    Signed-off-by: Miao Xie <miaoxie@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ae2a66470bd70480e4953ff12bc96902e0b59617
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:45 2018 +0800

    staging: erofs: add erofs in-memory stuffs

     - erofs_sb_info:
       contains erofs-specific in-memory information.

     - erofs_vnode:
       contains vfs_inode and other fs-specific information.
       same as super block, the only one in-memory definition exists.

     - erofs_map_blocks
       plays a role in the file L2P mapping

    Signed-off-by: Miao Xie <miaoxie@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit dd48cb6b27dc6c5977e59e05c59209ddb68c2f51
Author: Gao Xiang <gaoxiang25@huawei.com>
Date:   Thu Jul 26 20:21:44 2018 +0800

    staging: erofs: add on-disk layout

    This commit adds the on-disk layout header file of erofs.

    Note that the on-disk layout is still WIP, and some fields are
    reserved for the future use by design.

    Any comments are welcome.

    Thanks-to: Li Guifu <liguifu2@huawei.com>
    Thanks-to: Sun Qiuyang <sunqiuyang@huawei.com>
    Signed-off-by: Miao Xie <miaoxie@huawei.com>
    Signed-off-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-21 13:29:19 +02:00
pwnrazr
65ec0e6cdd Merge branch 'dev-base' into dev-pwn 2022-11-30 10:37:47 +02:00
Mark Rutland
583c56f181 locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE()
Please do not apply this to mainline directly, instead please re-run the
coccinelle script shown below and apply its output.

For several reasons, it is desirable to use {READ,WRITE}_ONCE() in
preference to ACCESS_ONCE(), and new code is expected to use one of the
former. So far, there's been no reason to change most existing uses of
ACCESS_ONCE(), as these aren't harmful, and changing them results in
churn.

However, for some features, the read/write distinction is critical to
correct operation. To distinguish these cases, separate read/write
accessors must be used. This patch migrates (most) remaining
ACCESS_ONCE() instances to {READ,WRITE}_ONCE(), using the following
coccinelle script:

----
// Convert trivial ACCESS_ONCE() uses to equivalent READ_ONCE() and
// WRITE_ONCE()

// $ make coccicheck COCCI=/home/mark/once.cocci SPFLAGS="--include-headers" MODE=patch

virtual patch

@ depends on patch @
expression E1, E2;
@@

- ACCESS_ONCE(E1) = E2
+ WRITE_ONCE(E1, E2)

@ depends on patch @
expression E;
@@

- ACCESS_ONCE(E)
+ READ_ONCE(E)
----

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: davem@davemloft.net
Cc: linux-arch@vger.kernel.org
Cc: mpe@ellerman.id.au
Cc: shuah@kernel.org
Cc: snitzer@redhat.com
Cc: thor.thayer@linux.intel.com
Cc: tj@kernel.org
Cc: viro@zeniv.linux.org.uk
Cc: will.deacon@arm.com
Link: http://lkml.kernel.org/r/1508792849-3115-19-git-send-email-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: atndko <z1281552865@gmail.com>
2022-04-11 08:52:28 +00:00
Mel Gorman
7698434169 mm, pagevec: remove cold parameter for pagevecs
Every pagevec_init user claims the pages being released are hot even in
cases where it is unlikely the pages are hot.  As no one cares about the
hotness of pages being released to the allocator, just ditch the
parameter.

No performance impact is expected as the overhead is marginal.  The
parameter is removed simply because it is a bit stupid to have a useless
parameter copied everywhere.

Link: http://lkml.kernel.org/r/20171018075952.10627-6-mgorman@techsingularity.net
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
2022-04-03 15:15:45 +00:00
Jens Axboe
0a6d9d5c78 buffer: eliminate the need to call free_more_memory() in __getblk_slow()
Since the previous commit removed any case where grow_buffers()
would return failure due to memory allocations, we can safely
remove the case where we have to call free_more_memory() in
this function.

Since this is also the last user of free_more_memory(), kill
it off completely.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-07-19 11:19:38 +00:00
Jens Axboe
19adf1a1dc buffer: grow_dev_page() should use __GFP_NOFAIL for all cases
We currently use it for find_or_create_page(), which means that it
cannot fail. Ensure we also pass in 'retry == true' to
alloc_page_buffers(), which also ensure that it cannot fail.

After this, there are no failure cases in grow_dev_page() that
occur because of a failed memory allocation.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-07-19 11:19:38 +00:00
Jens Axboe
95171b7f64 buffer: have alloc_page_buffers() use __GFP_NOFAIL
Instead of adding weird retry logic in that function, utilize
__GFP_NOFAIL to ensure that the vm takes care of handling any
potential retries appropriately. This means we don't have to
call free_more_memory() from here.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-07-19 11:19:32 +00:00
UtsavBalar1231
f27a280c21 Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-4.14.y' into android11-base
* aosp/upstream-f2fs-stable-linux-4.14.y:
  f2fs: compress: fix compression chksum
  f2fs: fix shift-out-of-bounds in sanity_check_raw_super()
  f2fs: fix race of pending_pages in decompression
  f2fs: fix to account inline xattr correctly during recovery
  f2fs: inline: fix wrong inline inode stat
  f2fs: inline: correct comment in f2fs_recover_inline_data
  f2fs: don't check PAGE_SIZE again in sanity_check_raw_super()
  f2fs: convert to F2FS_*_INO macro
  f2fs: introduce max_io_bytes, a sysfs entry, to limit bio size
  f2fs: don't allow any writes on readonly mount
  f2fs: avoid race condition for shrinker count
  f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE
  f2fs: add compress_mode mount option
  f2fs: Remove unnecessary unlikely()
  f2fs: init dirty_secmap incorrectly
  f2fs: remove buffer_head which has 32bits limit
  f2fs: fix wrong block count instead of bytes
  f2fs: use new conversion functions between blks and bytes
  f2fs: rename logical_to_blk and blk_to_logical
  f2fs: fix kbytes written stat for multi-device case
  f2fs: compress: support chksum
  f2fs: fix to avoid REQ_TIME and CP_TIME collision
  f2fs: change to use rwsem for cp_mutex
  f2fs: Handle casefolding with Encryption
  fscrypt: Have filesystems handle their d_ops
  libfs: Add generic function for setting dentry_ops
  f2fs: Remove the redundancy initialization
  f2fs: remove writeback_inodes_sb in f2fs_remount
  f2fs: fix double free of unicode map
  f2fs: fix compat F2FS_IOC_{MOVE,GARBAGE_COLLECT}_RANGE
  f2fs: avoid unneeded data copy in f2fs_ioc_move_range()
  f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl
  f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl
  f2fs: move ioctl interface definitions to separated file
  f2fs: fix to seek incorrect data offset in inline data file
  f2fs: check fiemap parameters
  f2fs: call f2fs_get_meta_page_retry for nat page
  fscrypt: rename DCACHE_ENCRYPTED_NAME to DCACHE_NOKEY_NAME
  fscrypt: don't call no-key names "ciphertext names"
  fscrypt: export fscrypt_d_revalidate()
  f2fs: code cleanup by removing unnecessary check
  f2fs: wait for sysfs kobject removal before freeing f2fs_sb_info
  f2fs: fix writecount false positive in releasing compress blocks
  f2fs: introduce check_swap_activate_fast()
  f2fs: don't issue flush in f2fs_flush_device_cache() for nobarrier case
  f2fs: handle errors of f2fs_get_meta_page_nofail
  f2fs: fix to set SBI_NEED_FSCK flag for inconsistent inode
  f2fs: reject CASEFOLD inode flag without casefold feature
  f2fs: fix memory alignment to support 32bit
  f2fs: fix slab leak of rpages pointer
  f2fs: compress: fix to disallow enabling compress on non-empty file
  f2fs: compress: introduce cic/dic slab cache
  f2fs: compress: introduce page array slab cache
  f2fs: fix to do sanity check on segment/section count
  f2fs: fix to check segment boundary during SIT page readahead
  f2fs: fix uninit-value in f2fs_lookup
  fs/buffer.c: record blockdev write errors in super_block that it backs
  vfs: track per-sb writeback errors and report them to syncfs
  f2fs: remove unneeded parameter in find_in_block()
  f2fs: fix wrong total_sections check and fsmeta check
  f2fs: remove duplicated code in sanity_check_area_boundary
  f2fs: remove unused check on version_bitmap
  f2fs: relocate blkzoned feature check
  f2fs: do sanity check on zoned block device path
  f2fs: add trace exit in exception path
  f2fs: change return value of reserved_segments to unsigned int
  f2fs: clean up kvfree
  f2fs: change virtual mapping way for compression pages
  f2fs: change return value of f2fs_disable_compressed_file to bool
  f2fs: change i_compr_blocks of inode to atomic value
  f2fs: ignore compress mount option on image w/o compression feature
  f2fs: allocate proper size memory for zstd decompress
  f2fs: change compr_blocks of superblock info to 64bit
  f2fs: add block address limit check to compressed file
  f2fs: check position in move range ioctl
  f2fs: correct statistic of APP_DIRECT_IO/APP_DIRECT_READ_IO
  f2fs: support age threshold based garbage collection
  f2fs: Use generic casefolding support
  fs: Add standard casefolding support
  unicode: Add utf8_casefold_hash
  f2fs: compress: use more readable atomic_t type for {cic,dic}.ref
  f2fs: fix compile warning
  f2fs: support 64-bits key in f2fs rb-tree node entry
  f2fs: inherit mtime of original block during GC
  f2fs: record average update time of segment
  f2fs: introduce inmem curseg
  f2fs: compress: remove unneeded code
  f2fs: remove duplicated type casting
  f2fs: support zone capacity less than zone size
  f2fs: update changes in upstream on GC_URGENT_HIGH
  f2fs: Return EOF on unaligned end of file DIO read
  f2fs: fix indefinite loop scanning for free nid
  f2fs: Fix type of section block count variables
  f2fs: prepare a waiter before entering io_schedule
  f2fs: update_sit_entry: Make the judgment condition of f2fs_bug_on more intuitive
  f2fs: replace test_and_set/clear_bit() with set/clear_bit()
  f2fs: make file immutable even if releasing zero compression block
  f2fs: compress: disable compression mount option if compression is off
  f2fs: compress: add sanity check during compressed cluster read
  f2fs: use macro instead of f2fs verity version
  f2fs: fix deadlock between quota writes and checkpoint
  f2fs: correct comment of f2fs_exist_written_data
  f2fs: compress: delay temp page allocation
  f2fs: compress: fix to update isize when overwriting compressed file
  f2fs: space related cleanup
  f2fs: fix use-after-free issue
  f2fs: Change the type of f2fs_flush_inline_data() to void
  f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl
  f2fs: segment.h: delete a duplicated word
  f2fs: compress: fix to avoid memory leak on cc->cpages
  f2fs: use generic names for generic ioctls
  f2fs: don't keep meta inode pages used for compressed block migration
  f2fs: fix error path in do_recover_data()
  f2fs: fix to wait GCed compressed page writeback
  f2fs: remove write attribute of main_blkaddr sysfs node
  f2fs: add GC_URGENT_LOW mode in gc_urgent
  f2fs: avoid readahead race condition
  f2fs: fix return value of move_data_block()
  f2fs: add parameter op_flag in f2fs_submit_page_read()
  f2fs: split f2fs_allocate_new_segments()
  f2fs: lost matching-pair of trace in f2fs_truncate_inode_blocks
  f2fs: fix an oops in f2fs_is_compressed_page
  f2fs: make trace enter and end in pairs for unlink
  f2fs: fix to check page dirty status before writeback
  f2fs: remove the unused compr parameter
  f2fs: support to trace f2fs_fiemap()
  f2fs: support to trace f2fs_bmap()
  f2fs: fix wrong return value of f2fs_bmap_compress()
  f2fs: remove useless parameter of __insert_free_nid()
  f2fs: fix typo in comment of f2fs_do_add_link
  f2fs: fix to wait page writeback before update
  f2fs: show more debug info for per-temperature log
  f2fs: add f2fs_gc exception handle in f2fs_ioc_gc_range
  f2fs: clean up parameter of f2fs_allocate_data_block()
  f2fs: shrink node_write lock coverage
  f2fs: add prefix for exported symbols
  f2fs: use kfree() to free variables allocated by match_strdup()
  f2fs: get the right gc victim section when section has several segments
  f2fs: fix a race condition between f2fs_write_end_io and f2fs_del_fsync_node_entry
  f2fs: remove useless truncate in f2fs_collapse_range()
  f2fs: use kfree() instead of kvfree() to free superblock data
  f2fs: avoid checkpatch error
  f2fs: should avoid inode eviction in synchronous path

Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>

Conflicts:
	fs/crypto/fname.c
	fs/ext4/namei.c
	fs/f2fs/data.c
	fs/f2fs/dir.c
	fs/f2fs/file.c
	fs/f2fs/gc.c
	fs/f2fs/inline.c
	fs/f2fs/namei.c
	fs/f2fs/super.c
	fs/libfs.c
	fs/ubifs/dir.c
	fs/unicode/utf8-core.c
	include/linux/fs.h
	include/linux/fscrypt.h

Change-Id: I7530ee7aac53555c81955a3b07c12fa6ea5ed7ef
2021-02-05 16:48:39 +05:30
Srinivasarao P
74c939fb16 Merge android-4.14-stable.206 (7b43d74) into msm-4.14
* refs/heads/tmp-7b43d74:
  Revert USB changes
  Linux 4.14.206
  powercap: restrict energy meter to root access
  Linux 4.14.205
  arm64: dts: marvell: espressobin: add ethernet alias
  PM: runtime: Resume the device earlier in __device_release_driver()
  Revert "ARC: entry: fix potential EFA clobber when TIF_SYSCALL_TRACE"
  ARC: stack unwinding: avoid indefinite looping
  usb: mtu3: fix panic in mtu3_gadget_stop()
  USB: Add NO_LPM quirk for Kingston flash drive
  USB: serial: option: add Telit FN980 composition 0x1055
  USB: serial: option: add LE910Cx compositions 0x1203, 0x1230, 0x1231
  USB: serial: option: add Quectel EC200T module support
  USB: serial: cyberjack: fix write-URB completion race
  serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init
  serial: 8250_mtk: Fix uart_get_baud_rate warning
  fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent
  vt: Disable KD_FONT_OP_COPY
  ACPI: NFIT: Fix comparison to '-ENXIO'
  drm/vc4: drv: Add error handding for bind
  vsock: use ns_capable_noaudit() on socket create
  scsi: core: Don't start concurrent async scan on same host
  blk-cgroup: Pre-allocate tree node on blkg_conf_prep
  blk-cgroup: Fix memleak on error path
  of: Fix reserved-memory overlap detection
  x86/kexec: Use up-to-dated screen_info copy to fill boot params
  ARM: dts: sun4i-a10: fix cpu_alert temperature
  futex: Handle transient "ownerless" rtmutex state correctly
  tracing: Fix out of bounds write in get_trace_buf
  ftrace: Handle tracing when switching between context
  ftrace: Fix recursion check for NMI test
  gfs2: Wake up when sd_glock_disposal becomes zero
  mm: always have io_remap_pfn_range() set pgprot_decrypted()
  kthread_worker: prevent queuing delayed work from timer_fn when it is being canceled
  lib/crc32test: remove extra local_irq_disable/enable
  ALSA: usb-audio: Add implicit feedback quirk for Qu-16
  Fonts: Replace discarded const qualifier
  i40e: Memory leak in i40e_config_iwarp_qvlist
  i40e: Fix of memory leak and integer truncation in i40e_virtchnl.c
  i40e: Wrong truncation from u16 to u8
  i40e: add num_vectors checker in iwarp handler
  i40e: Fix a potential NULL pointer dereference
  blktrace: fix debugfs use after free
  Blktrace: bail out early if block debugfs is not configured
  sfp: Fix error handing in sfp_probe()
  sctp: Fix COMM_LOST/CANT_STR_ASSOC err reporting on big-endian platforms
  net: usb: qmi_wwan: add Telit LE910Cx 0x1230 composition
  gianfar: Account for Tx PTP timestamp in the skb headroom
  gianfar: Replace skb_realloc_headroom with skb_cow_head for PTP
  tipc: fix use-after-free in tipc_bcast_get_mode
  xen/events: don't use chip_data for legacy IRQs
  drm/i915: Break up error capture compression loops with cond_resched()
  ANDROID: Temporarily disable XFRM_USER_COMPAT filtering
  Linux 4.14.204
  staging: octeon: Drop on uncorrectable alignment or FCS error
  staging: octeon: repair "fixed-link" support
  staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice
  KVM: arm64: Fix AArch32 handling of DBGD{CCINT,SCRext} and DBGVCR
  device property: Don't clear secondary pointer for shared primary firmware node
  device property: Keep secondary firmware node secondary by type
  ARM: s3c24xx: fix missing system reset
  ARM: samsung: fix PM debug build with DEBUG_LL but !MMU
  arm: dts: mt7623: add missing pause for switchport
  hil/parisc: Disable HIL driver when it gets stuck
  cachefiles: Handle readpage error correctly
  arm64: berlin: Select DW_APB_TIMER_OF
  tty: make FONTX ioctl use the tty pointer they were actually passed
  rtc: rx8010: don't modify the global rtc ops
  drm/ttm: fix eviction valuable range check.
  ext4: fix invalid inode checksum
  ext4: fix error handling code in add_new_gdb
  ext4: fix leaking sysfs kobject after failed mount
  vringh: fix __vringh_iov() when riov and wiov are different
  ring-buffer: Return 0 on success from ring_buffer_resize()
  9P: Cast to loff_t before multiplying
  libceph: clear con->out_msg on Policy::stateful_server faults
  ceph: promote to unsigned long long before shifting
  drm/amdgpu: don't map BO in reserved region
  ia64: fix build error with !COREDUMP
  ubi: check kthread_should_stop() after the setting of task state
  perf python scripting: Fix printable strings in python3 scripts
  ubifs: dent: Fix some potential memory leaks while iterating entries
  NFSD: Add missing NFSv2 .pc_func methods
  NFSv4.2: support EXCHGID4_FLAG_SUPP_FENCE_OPS 4.2 EXCHANGE_ID flag
  powerpc/powernv/elog: Fix race while processing OPAL error log event.
  powerpc: Warn about use of smt_snooze_delay
  powerpc/rtas: Restrict RTAS requests from userspace
  s390/stp: add locking to sysfs functions
  iio:gyro:itg3200: Fix timestamp alignment and prevent data leak.
  iio:adc:ti-adc12138 Fix alignment issue with timestamp
  iio:adc:ti-adc0832 Fix alignment issue with timestamp
  iio:light:si1145: Fix timestamp alignment and prevent data leak.
  dmaengine: dma-jz4780: Fix race in jz4780_dma_tx_status
  vt: keyboard, extend func_buf_lock to readers
  vt: keyboard, simplify vt_kdgkbsent
  drm/i915: Force VT'd workarounds when running as a guest OS
  usb: host: fsl-mph-dr-of: check return of dma_set_mask()
  usb: cdc-acm: fix cooldown mechanism
  usb: dwc3: core: don't trigger runtime pm when remove driver
  usb: dwc3: core: add phy cleanup for probe error handling
  usb: dwc3: ep0: Fix ZLP for OUT ep0 requests
  btrfs: fix use-after-free on readahead extent after failure to create it
  btrfs: cleanup cow block on error
  btrfs: use kvzalloc() to allocate clone_roots in btrfs_ioctl_send()
  btrfs: send, recompute reference path after orphanization of a directory
  btrfs: reschedule if necessary when logging directory items
  scsi: mptfusion: Fix null pointer dereferences in mptscsih_remove()
  w1: mxc_w1: Fix timeout resolution problem leading to bus error
  acpi-cpufreq: Honor _PSD table setting on new AMD CPUs
  ACPI: debug: don't allow debugging when ACPI is disabled
  ACPI: video: use ACPI backlight for HP 635 Notebook
  ACPI / extlog: Check for RDMSR failure
  NFS: fix nfs_path in case of a rename retry
  fs: Don't invalidate page buffers in block_write_full_page()
  leds: bcm6328, bcm6358: use devres LED registering function
  perf/x86/amd/ibs: Fix raw sample data accumulation
  perf/x86/amd/ibs: Don't include randomized bits in get_ibs_op_count()
  md/raid5: fix oops during stripe resizing
  nvme-rdma: fix crash when connect rejected
  sgl_alloc_order: fix memory leak
  nbd: make the config put is called before the notifying the waiter
  ARM: dts: s5pv210: remove dedicated 'audio-subsystem' node
  ARM: dts: s5pv210: move PMU node out of clock controller
  ARM: dts: s5pv210: remove DMA controller bus node name to fix dtschema warnings
  memory: emif: Remove bogus debugfs error handling
  arm64: dts: renesas: ulcb: add full-pwr-cycle-in-suspend into eMMC nodes
  gfs2: add validation checks for size of superblock
  ext4: Detect already used quota file early
  drivers: watchdog: rdc321x_wdt: Fix race condition bugs
  net: 9p: initialize sun_server.sun_path to have addr's value only when addr is valid
  clk: ti: clockdomain: fix static checker warning
  bnxt_en: Log unknown link speed appropriately.
  md/bitmap: md_bitmap_get_counter returns wrong blocks
  power: supply: test_power: add missing newlines when printing parameters by sysfs
  bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
  drivers/net/wan/hdlc_fr: Correctly handle special skb->protocol values
  ACPI: Add out of bounds and numa_off protections to pxm_to_node()
  arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE
  uio: free uio id after uio file node is freed
  USB: adutux: fix debugging
  cpufreq: sti-cpufreq: add stih418 support
  kgdb: Make "kgdbcon" work properly with "kgdb_earlycon"
  printk: reduce LOG_BUF_SHIFT range for H8300
  drm/bridge/synopsys: dsi: add support for non-continuous HS clock
  mmc: via-sdmmc: Fix data race bug
  media: tw5864: check status of tw5864_frameinterval_get
  usb: typec: tcpm: During PR_SWAP, source caps should be sent only after tSwapSourceStart
  media: platform: Improve queue set up flow for bug fixing
  media: videodev2.h: RGB BT2020 and HSV are always full range
  drm/brige/megachips: Add checking if ge_b850v3_lvds_init() is working correctly
  ath10k: fix VHT NSS calculation when STBC is enabled
  ath10k: start recovery process when payload length exceeds max htc length for sdio
  video: fbdev: pvr2fb: initialize variables
  xfs: fix realtime bitmap/summary file truncation when growing rt volume
  ARM: 8997/2: hw_breakpoint: Handle inexact watchpoint addresses
  um: change sigio_spinlock to a mutex
  f2fs: fix to check segment boundary during SIT page readahead
  f2fs: add trace exit in exception path
  sparc64: remove mm_cpumask clearing to fix kthread_use_mm race
  powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
  powerpc/powernv/smp: Fix spurious DBG() warning
  futex: Fix incorrect should_fail_futex() handling
  mlxsw: core: Fix use-after-free in mlxsw_emad_trans_finish()
  x86/unwind/orc: Fix inactive tasks with stack pointer in %sp on GCC 10 compiled kernels
  fscrypt: return -EXDEV for incompatible rename or link into encrypted dir
  ata: sata_rcar: Fix DMA boundary mask
  mtd: lpddr: Fix bad logic in print_drs_error
  p54: avoid accessing the data mapped to streaming DMA
  fuse: fix page dereference after free
  x86/xen: disable Firmware First mode for correctable memory errors
  arch/x86/amd/ibs: Fix re-arming IBS Fetch
  tipc: fix memory leak caused by tipc_buf_append()
  ravb: Fix bit fields checking in ravb_hwtstamp_get()
  gtp: fix an use-before-init in gtp_newlink()
  efivarfs: Replace invalid slashes with exclamation marks in dentries.
  arm64: link with -z norelro regardless of CONFIG_RELOCATABLE
  scripts/setlocalversion: make git describe output more reliable
  UPSTREAM: mm/sl[uo]b: export __kmalloc_track(_node)_caller
  BACKPORT: xfrm/compat: Translate 32-bit user_policy from sockptr
  BACKPORT: xfrm/compat: Add 32=>64-bit messages translator
  UPSTREAM: xfrm/compat: Attach xfrm dumps to 64=>32 bit translator
  UPSTREAM: xfrm/compat: Add 64=>32-bit messages translator
  BACKPORT: xfrm: Provide API to register translator module
  ANDROID: Publish uncompressed Image on aarch64
  Linux 4.14.203
  powerpc/powernv/opal-dump : Use IRQ_HANDLED instead of numbers in interrupt handler
  usb: gadget: f_ncm: allow using NCM in SuperSpeed Plus gadgets.
  eeprom: at25: set minimum read/write access stride to 1
  USB: cdc-wdm: Make wdm_flush() interruptible and add wdm_fsync().
  usb: cdc-acm: add quirk to blacklist ETAS ES58X devices
  tty: serial: fsl_lpuart: fix lpuart32_poll_get_char
  net: korina: cast KSEG0 address to pointer in kfree
  ath10k: check idx validity in __ath10k_htt_rx_ring_fill_n()
  scsi: ufs: ufs-qcom: Fix race conditions caused by ufs_qcom_testbus_config()
  usb: core: Solve race condition in anchor cleanup functions
  brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach
  mwifiex: don't call del_timer_sync() on uninitialized timer
  reiserfs: Fix memory leak in reiserfs_parse_options()
  ipvs: Fix uninit-value in do_ip_vs_set_ctl()
  tty: ipwireless: fix error handling
  scsi: qedi: Fix list_del corruption while removing active I/O
  scsi: qedi: Protect active command list to avoid list corruption
  Fix use after free in get_capset_info callback.
  rtl8xxxu: prevent potential memory leak
  brcmsmac: fix memory leak in wlc_phy_attach_lcnphy
  scsi: ibmvfc: Fix error return in ibmvfc_probe()
  Bluetooth: Only mark socket zapped after unlocking
  usb: ohci: Default to per-port over-current protection
  xfs: make sure the rt allocator doesn't run off the end
  reiserfs: only call unlock_new_inode() if I_NEW
  misc: rtsx: Fix memory leak in rtsx_pci_probe
  ath9k: hif_usb: fix race condition between usb_get_urb() and usb_kill_anchored_urbs()
  can: flexcan: flexcan_chip_stop(): add error handling and propagate error value
  USB: cdc-acm: handle broken union descriptors
  udf: Avoid accessing uninitialized data on failed inode read
  udf: Limit sparing table size
  usb: gadget: function: printer: fix use-after-free in __lock_acquire
  misc: vop: add round_up(x,4) for vring_size to avoid kernel panic
  mic: vop: copy data to kernel space then write to io memory
  scsi: target: core: Add CONTROL field for trace events
  scsi: mvumi: Fix error return in mvumi_io_attach()
  PM: hibernate: remove the bogus call to get_gendisk() in software_resume()
  mac80211: handle lack of sband->bitrates in rates
  ntfs: add check for mft record size in superblock
  media: venus: core: Fix runtime PM imbalance in venus_probe
  fs: dlm: fix configfs memory leak
  media: saa7134: avoid a shift overflow
  mmc: sdio: Check for CISTPL_VERS_1 buffer size
  media: uvcvideo: Ensure all probed info is returned to v4l2
  media: media/pci: prevent memory leak in bttv_probe
  media: bdisp: Fix runtime PM imbalance on error
  media: platform: sti: hva: Fix runtime PM imbalance on error
  media: platform: s3c-camif: Fix runtime PM imbalance on error
  media: vsp1: Fix runtime PM imbalance on error
  media: exynos4-is: Fix a reference count leak
  media: exynos4-is: Fix a reference count leak due to pm_runtime_get_sync
  media: exynos4-is: Fix several reference count leaks due to pm_runtime_get_sync
  media: sti: Fix reference count leaks
  media: st-delta: Fix reference count leak in delta_run_work
  media: ati_remote: sanity check for both endpoints
  media: firewire: fix memory leak
  crypto: ccp - fix error handling
  i2c: core: Restore acpi_walk_dep_device_list() getting called after registering the ACPI i2c devs
  perf: correct SNOOPX field offset
  NTB: hw: amd: fix an issue about leak system resources
  nvmet: fix uninitialized work for zero kato
  powerpc/powernv/dump: Fix race while processing OPAL dump
  arm64: dts: zynqmp: Remove additional compatible string for i2c IPs
  ARM: dts: owl-s500: Fix incorrect PPI interrupt specifiers
  arm64: dts: qcom: msm8916: Fix MDP/DSI interrupts
  memory: fsl-corenet-cf: Fix handling of platform_get_irq() error
  memory: omap-gpmc: Fix a couple off by ones
  KVM: x86: emulating RDPID failure shall return #UD rather than #GP
  Input: sun4i-ps2 - fix handling of platform_get_irq() error
  Input: twl4030_keypad - fix handling of platform_get_irq() error
  Input: omap4-keypad - fix handling of platform_get_irq() error
  Input: ep93xx_keypad - fix handling of platform_get_irq() error
  Input: stmfts - fix a & vs && typo
  Input: imx6ul_tsc - clean up some errors in imx6ul_tsc_resume()
  vfio iommu type1: Fix memory leak in vfio_iommu_type1_pin_pages
  vfio/pci: Clear token on bypass registration failure
  ext4: limit entries returned when counting fsmap records
  clk: bcm2835: add missing release if devm_clk_hw_register fails
  clk: at91: clk-main: update key before writing AT91_CKGR_MOR
  PCI: iproc: Set affinity mask on MSI interrupts
  i2c: rcar: Auto select RESET_CONTROLLER
  mailbox: avoid timer start from callback
  rapidio: fix the missed put_device() for rio_mport_add_riodev
  rapidio: fix error handling path
  ramfs: fix nommu mmap with gaps in the page cache
  lib/crc32.c: fix trivial typo in preprocessor condition
  f2fs: wait for sysfs kobject removal before freeing f2fs_sb_info
  IB/rdmavt: Fix sizeof mismatch
  cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_reboot_notifier
  powerpc/perf/hv-gpci: Fix starting index value
  powerpc/perf: Exclude pmc5/6 from the irrelevant PMU group constraints
  overflow: Include header file with SIZE_MAX declaration
  kdb: Fix pager search for multi-line strings
  RDMA/hns: Set the unsupported wr opcode
  perf intel-pt: Fix "context_switch event has no tid" error
  powerpc/tau: Disable TAU between measurements
  powerpc/tau: Remove duplicated set_thresholds() call
  powerpc/tau: Use appropriate temperature sample interval
  RDMA/qedr: Fix use of uninitialized field
  xfs: limit entries returned when counting fsmap records
  arc: plat-hsdk: fix kconfig dependency warning when !RESET_CONTROLLER
  ARM: 9007/1: l2c: fix prefetch bits init in L2X0_AUX_CTRL using DT values
  mtd: mtdoops: Don't write panic data twice
  mtd: lpddr: fix excessive stack usage with clang
  powerpc/icp-hv: Fix missing of_node_put() in success path
  powerpc/pseries: Fix missing of_node_put() in rng_init()
  IB/mlx4: Adjust delayed work when a dup is observed
  IB/mlx4: Fix starvation in paravirt mux/demux
  mm, oom_adj: don't loop through tasks in __set_oom_adj when not necessary
  mm/memcg: fix device private memcg accounting
  net: korina: fix kfree of rx/tx descriptor array
  mwifiex: fix double free
  scsi: be2iscsi: Fix a theoretical leak in beiscsi_create_eqs()
  usb: dwc2: Fix INTR OUT transfers in DDMA mode.
  nl80211: fix non-split wiphy information
  usb: gadget: u_ether: enable qmult on SuperSpeed Plus as well
  usb: gadget: f_ncm: fix ncm_bitrate for SuperSpeed and above.
  iwlwifi: mvm: split a print to avoid a WARNING in ROC
  mfd: sm501: Fix leaks in probe()
  net: enic: Cure the enic api locking trainwreck
  qtnfmac: fix resource leaks on unsupported iftype error return path
  HID: hid-input: fix stylus battery reporting
  quota: clear padding in v2r1_mem2diskdqb()
  usb: dwc2: Fix parameter type in function pointer prototype
  ALSA: seq: oss: Avoid mutex lock for a long-time ioctl
  misc: mic: scif: Fix error handling path
  ath6kl: wmi: prevent a shift wrapping bug in ath6kl_wmi_delete_pstream_cmd()
  pinctrl: mcp23s08: Fix mcp23x17 precious range
  pinctrl: mcp23s08: Fix mcp23x17_regmap initialiser
  HID: roccat: add bounds checking in kone_sysfs_write_settings()
  video: fbdev: sis: fix null ptr dereference
  video: fbdev: vga16fb: fix setting of pixclock because a pass-by-value error
  drivers/virt/fsl_hypervisor: Fix error handling path
  pwm: lpss: Add range limit check for the base_unit register value
  pwm: lpss: Fix off by one error in base_unit math in pwm_lpss_prepare()
  pty: do tty_flip_buffer_push without port->lock in pty_write
  tty: hvcs: Don't NULL tty->driver_data until hvcs_cleanup()
  tty: serial: earlycon dependency
  VMCI: check return value of get_user_pages_fast() for errors
  backlight: sky81452-backlight: Fix refcount imbalance on error
  scsi: csiostor: Fix wrong return value in csio_hw_prep_fw()
  scsi: qla4xxx: Fix an error handling path in 'qla4xxx_get_host_stats()'
  drm/gma500: fix error check
  mwifiex: Do not use GFP_KERNEL in atomic context
  brcmfmac: check ndev pointer
  ASoC: qcom: lpass-cpu: fix concurrency issue
  ASoC: qcom: lpass-platform: fix memory leak
  wcn36xx: Fix reported 802.11n rx_highest rate wcn3660/wcn3680
  ath9k: Fix potential out of bounds in ath9k_htc_txcompletion_cb()
  ath6kl: prevent potential array overflow in ath6kl_add_new_sta()
  Bluetooth: hci_uart: Cancel init work before unregistering
  ath10k: provide survey info as accumulated data
  regulator: resolve supply after creating regulator
  media: ti-vpe: Fix a missing check and reference count leak
  media: s5p-mfc: Fix a reference count leak
  media: platform: fcp: Fix a reference count leak.
  media: tc358743: initialize variable
  media: mx2_emmaprp: Fix memleak in emmaprp_probe
  cypto: mediatek - fix leaks in mtk_desc_ring_alloc
  crypto: omap-sham - fix digcnt register handling with export/import
  media: omap3isp: Fix memleak in isp_probe
  media: uvcvideo: Set media controller entity functions
  media: m5mols: Check function pointer in m5mols_sensor_power
  media: Revert "media: exynos4-is: Add missed check for pinctrl_lookup_state()"
  media: tuner-simple: fix regression in simple_set_radio_freq
  crypto: ixp4xx - Fix the size used in a 'dma_free_coherent()' call
  crypto: mediatek - Fix wrong return value in mtk_desc_ring_alloc()
  crypto: algif_skcipher - EBUSY on aio should be an error
  drivers/perf: xgene_pmu: Fix uninitialized resource struct
  x86/fpu: Allow multiple bits in clearcpuid= parameter
  EDAC/i5100: Fix error handling order in i5100_init_one()
  crypto: algif_aead - Do not set MAY_BACKLOG on the async path
  ima: Don't ignore errors from crypto_shash_update()
  KVM: SVM: Initialize prev_ga_tag before use
  KVM: x86/mmu: Commit zap of remaining invalid pages when recovering lpages
  cifs: Return the error from crypt_message when enc/dec key not found.
  cifs: remove bogus debug code
  icmp: randomize the global rate limiter
  tcp: fix to update snd_wl1 in bulk receiver fast path
  nfc: Ensure presence of NFC_ATTR_FIRMWARE_NAME attribute in nfc_genl_fw_download()
  net: hdlc_raw_eth: Clear the IFF_TX_SKB_SHARING flag after calling ether_setup
  net: hdlc: In hdlc_rcv, check to make sure dev is an HDLC device
  ALSA: bebob: potential info leak in hwdep_read()
  binder: fix UAF when releasing todo list
  r8169: fix data corruption issue on RTL8402
  net/ipv4: always honour route mtu during forwarding
  tipc: fix the skb_unshare() in tipc_buf_append()
  net: usb: qmi_wwan: add Cellient MPL200 card
  mlx4: handle non-napi callers to napi_poll
  ipv4: Restore flowi4_oif update before call to xfrm_lookup_route
  ibmveth: Identify ingress large send packets.
  ibmveth: Switch order of ibmveth_helper calls.
  ANDROID: GKI: Enable CONFIG_X86_X2APIC
  UPSTREAM: binder: fix UAF when releasing todo list

 Conflicts:
	drivers/mailbox/mailbox.c
	drivers/scsi/ufs/ufs-qcom.c

Change-Id: Ic48321a27b8984cb769a9f11b5ce3d62efeb78fa
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2020-11-18 12:25:49 +05:30
Greg Kroah-Hartman
890226def6 Merge 4.14.204 into android-4.14-stable
Changes in 4.14.204
	scripts/setlocalversion: make git describe output more reliable
	arm64: link with -z norelro regardless of CONFIG_RELOCATABLE
	efivarfs: Replace invalid slashes with exclamation marks in dentries.
	gtp: fix an use-before-init in gtp_newlink()
	ravb: Fix bit fields checking in ravb_hwtstamp_get()
	tipc: fix memory leak caused by tipc_buf_append()
	arch/x86/amd/ibs: Fix re-arming IBS Fetch
	x86/xen: disable Firmware First mode for correctable memory errors
	fuse: fix page dereference after free
	p54: avoid accessing the data mapped to streaming DMA
	mtd: lpddr: Fix bad logic in print_drs_error
	ata: sata_rcar: Fix DMA boundary mask
	fscrypt: return -EXDEV for incompatible rename or link into encrypted dir
	x86/unwind/orc: Fix inactive tasks with stack pointer in %sp on GCC 10 compiled kernels
	mlxsw: core: Fix use-after-free in mlxsw_emad_trans_finish()
	futex: Fix incorrect should_fail_futex() handling
	powerpc/powernv/smp: Fix spurious DBG() warning
	powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
	sparc64: remove mm_cpumask clearing to fix kthread_use_mm race
	f2fs: add trace exit in exception path
	f2fs: fix to check segment boundary during SIT page readahead
	um: change sigio_spinlock to a mutex
	ARM: 8997/2: hw_breakpoint: Handle inexact watchpoint addresses
	xfs: fix realtime bitmap/summary file truncation when growing rt volume
	video: fbdev: pvr2fb: initialize variables
	ath10k: start recovery process when payload length exceeds max htc length for sdio
	ath10k: fix VHT NSS calculation when STBC is enabled
	drm/brige/megachips: Add checking if ge_b850v3_lvds_init() is working correctly
	media: videodev2.h: RGB BT2020 and HSV are always full range
	media: platform: Improve queue set up flow for bug fixing
	usb: typec: tcpm: During PR_SWAP, source caps should be sent only after tSwapSourceStart
	media: tw5864: check status of tw5864_frameinterval_get
	mmc: via-sdmmc: Fix data race bug
	drm/bridge/synopsys: dsi: add support for non-continuous HS clock
	printk: reduce LOG_BUF_SHIFT range for H8300
	kgdb: Make "kgdbcon" work properly with "kgdb_earlycon"
	cpufreq: sti-cpufreq: add stih418 support
	USB: adutux: fix debugging
	uio: free uio id after uio file node is freed
	arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE
	ACPI: Add out of bounds and numa_off protections to pxm_to_node()
	drivers/net/wan/hdlc_fr: Correctly handle special skb->protocol values
	bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
	power: supply: test_power: add missing newlines when printing parameters by sysfs
	md/bitmap: md_bitmap_get_counter returns wrong blocks
	bnxt_en: Log unknown link speed appropriately.
	clk: ti: clockdomain: fix static checker warning
	net: 9p: initialize sun_server.sun_path to have addr's value only when addr is valid
	drivers: watchdog: rdc321x_wdt: Fix race condition bugs
	ext4: Detect already used quota file early
	gfs2: add validation checks for size of superblock
	arm64: dts: renesas: ulcb: add full-pwr-cycle-in-suspend into eMMC nodes
	memory: emif: Remove bogus debugfs error handling
	ARM: dts: s5pv210: remove DMA controller bus node name to fix dtschema warnings
	ARM: dts: s5pv210: move PMU node out of clock controller
	ARM: dts: s5pv210: remove dedicated 'audio-subsystem' node
	nbd: make the config put is called before the notifying the waiter
	sgl_alloc_order: fix memory leak
	nvme-rdma: fix crash when connect rejected
	md/raid5: fix oops during stripe resizing
	perf/x86/amd/ibs: Don't include randomized bits in get_ibs_op_count()
	perf/x86/amd/ibs: Fix raw sample data accumulation
	leds: bcm6328, bcm6358: use devres LED registering function
	fs: Don't invalidate page buffers in block_write_full_page()
	NFS: fix nfs_path in case of a rename retry
	ACPI / extlog: Check for RDMSR failure
	ACPI: video: use ACPI backlight for HP 635 Notebook
	ACPI: debug: don't allow debugging when ACPI is disabled
	acpi-cpufreq: Honor _PSD table setting on new AMD CPUs
	w1: mxc_w1: Fix timeout resolution problem leading to bus error
	scsi: mptfusion: Fix null pointer dereferences in mptscsih_remove()
	btrfs: reschedule if necessary when logging directory items
	btrfs: send, recompute reference path after orphanization of a directory
	btrfs: use kvzalloc() to allocate clone_roots in btrfs_ioctl_send()
	btrfs: cleanup cow block on error
	btrfs: fix use-after-free on readahead extent after failure to create it
	usb: dwc3: ep0: Fix ZLP for OUT ep0 requests
	usb: dwc3: core: add phy cleanup for probe error handling
	usb: dwc3: core: don't trigger runtime pm when remove driver
	usb: cdc-acm: fix cooldown mechanism
	usb: host: fsl-mph-dr-of: check return of dma_set_mask()
	drm/i915: Force VT'd workarounds when running as a guest OS
	vt: keyboard, simplify vt_kdgkbsent
	vt: keyboard, extend func_buf_lock to readers
	dmaengine: dma-jz4780: Fix race in jz4780_dma_tx_status
	iio:light:si1145: Fix timestamp alignment and prevent data leak.
	iio:adc:ti-adc0832 Fix alignment issue with timestamp
	iio:adc:ti-adc12138 Fix alignment issue with timestamp
	iio:gyro:itg3200: Fix timestamp alignment and prevent data leak.
	s390/stp: add locking to sysfs functions
	powerpc/rtas: Restrict RTAS requests from userspace
	powerpc: Warn about use of smt_snooze_delay
	powerpc/powernv/elog: Fix race while processing OPAL error log event.
	NFSv4.2: support EXCHGID4_FLAG_SUPP_FENCE_OPS 4.2 EXCHANGE_ID flag
	NFSD: Add missing NFSv2 .pc_func methods
	ubifs: dent: Fix some potential memory leaks while iterating entries
	perf python scripting: Fix printable strings in python3 scripts
	ubi: check kthread_should_stop() after the setting of task state
	ia64: fix build error with !COREDUMP
	drm/amdgpu: don't map BO in reserved region
	ceph: promote to unsigned long long before shifting
	libceph: clear con->out_msg on Policy::stateful_server faults
	9P: Cast to loff_t before multiplying
	ring-buffer: Return 0 on success from ring_buffer_resize()
	vringh: fix __vringh_iov() when riov and wiov are different
	ext4: fix leaking sysfs kobject after failed mount
	ext4: fix error handling code in add_new_gdb
	ext4: fix invalid inode checksum
	drm/ttm: fix eviction valuable range check.
	rtc: rx8010: don't modify the global rtc ops
	tty: make FONTX ioctl use the tty pointer they were actually passed
	arm64: berlin: Select DW_APB_TIMER_OF
	cachefiles: Handle readpage error correctly
	hil/parisc: Disable HIL driver when it gets stuck
	arm: dts: mt7623: add missing pause for switchport
	ARM: samsung: fix PM debug build with DEBUG_LL but !MMU
	ARM: s3c24xx: fix missing system reset
	device property: Keep secondary firmware node secondary by type
	device property: Don't clear secondary pointer for shared primary firmware node
	KVM: arm64: Fix AArch32 handling of DBGD{CCINT,SCRext} and DBGVCR
	staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice
	staging: octeon: repair "fixed-link" support
	staging: octeon: Drop on uncorrectable alignment or FCS error
	Linux 4.14.204

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ibed153216ddb983a9ef0640ae9c82781f51880fe
2020-11-05 13:16:23 +01:00
Jan Kara
7ed80e77c9 fs: Don't invalidate page buffers in block_write_full_page()
commit 6dbf7bb555981fb5faf7b691e8f6169fc2b2e63b upstream.

If block_write_full_page() is called for a page that is beyond current
inode size, it will truncate page buffers for the page and return 0.
This logic has been added in 2.5.62 in commit 81eb69062588 ("fix ext3
BUG due to race with truncate") in history.git tree to fix a problem
with ext3 in data=ordered mode. This particular problem doesn't exist
anymore because ext3 is long gone and ext4 handles ordered data
differently. Also normally buffers are invalidated by truncate code and
there's no need to specially handle this in ->writepage() code.

This invalidation of page buffers in block_write_full_page() is causing
issues to filesystems (e.g. ext4 or ocfs2) when block device is shrunk
under filesystem's hands and metadata buffers get discarded while being
tracked by the journalling layer. Although it is obviously "not
supported" it can cause kernel crashes like:

[ 7986.689400] BUG: unable to handle kernel NULL pointer dereference at
+0000000000000008
[ 7986.697197] PGD 0 P4D 0
[ 7986.699724] Oops: 0002 [#1] SMP PTI
[ 7986.703200] CPU: 4 PID: 203778 Comm: jbd2/dm-3-8 Kdump: loaded Tainted: G
+O     --------- -  - 4.18.0-147.5.0.5.h126.eulerosv2r9.x86_64 #1
[ 7986.716438] Hardware name: Huawei RH2288H V3/BC11HGSA0, BIOS 1.57 08/11/2015
[ 7986.723462] RIP: 0010:jbd2_journal_grab_journal_head+0x1b/0x40 [jbd2]
...
[ 7986.810150] Call Trace:
[ 7986.812595]  __jbd2_journal_insert_checkpoint+0x23/0x70 [jbd2]
[ 7986.818408]  jbd2_journal_commit_transaction+0x155f/0x1b60 [jbd2]
[ 7986.836467]  kjournald2+0xbd/0x270 [jbd2]

which is not great. The crash happens because bh->b_private is suddently
NULL although BH_JBD flag is still set (this is because
block_invalidatepage() cleared BH_Mapped flag and subsequent bh lookup
found buffer without BH_Mapped set, called init_page_buffers() which has
rewritten bh->b_private). So just remove the invalidation in
block_write_full_page().

Note that the buffer cache invalidation when block device changes size
is already careful to avoid similar problems by using
invalidate_mapping_pages() which skips busy buffers so it was only this
odd block_write_full_page() behavior that could tear down bdev buffers
under filesystem's hands.

Reported-by: Ye Bin <yebin10@huawei.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Christoph Hellwig <hch@lst.de>
CC: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-05 11:06:58 +01:00
Jeff Layton
847d1e1234 fs/buffer.c: record blockdev write errors in super_block that it backs
When syncing out a block device (a'la __sync_blockdev), any error
encountered will only be recorded in the bd_inode's mapping.  When the
blockdev contains a filesystem however, we'd like to also record the
error in the super_block that's stored there.

Make mark_buffer_write_io_error also record the error in the
corresponding super_block when a writeback error occurs and the block
device contains a mounted superblock.

Since superblocks are RCU freed, hold the rcu_read_lock to ensure that
the superblock doesn't go away while we're marking it.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andres Freund <andres@anarazel.de>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Dave Chinner <david@fromorbit.com>
Link: http://lkml.kernel.org/r/20200428135155.19223-3-jlayton@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-09-29 02:21:41 -07:00
Srinivasarao P
f7e8bdc457 Merge android-4.14-stable.198 (a008686) into msm-4.14
* refs/heads/tmp-a008686:
  Linux 4.14.198
  net: disable netpoll on fresh napis
  tipc: fix shutdown() of connectionless socket
  sctp: not disable bh in the whole sctp_get_port_local()
  net: usb: dm9601: Add USB ID of Keenetic Plus DSL
  netlabel: fix problems with mapping removal
  bnxt: don't enable NAPI until rings are ready
  vfio/pci: Fix SR-IOV VF handling with MMIO blocking
  vfio-pci: Invalidate mmaps and block MMIO access on disabled memory
  vfio-pci: Fault mmaps to enable vma tracking
  vfio/type1: Support faulting PFNMAP vmas
  block: ensure bdi->io_pages is always initialized
  ALSA; firewire-tascam: exclude Tascam FE-8 from detection
  Linux 4.14.197
  net: usb: Fix uninit-was-stored issue in asix_read_phy_addr()
  cfg80211: regulatory: reject invalid hints
  mm/hugetlb: fix a race between hugetlb sysctl handlers
  checkpatch: fix the usage of capture group ( ... )
  KVM: arm64: Set HCR_EL2.PTW to prevent AT taking synchronous exception
  KVM: arm64: Survive synchronous exceptions caused by AT instructions
  KVM: arm64: Defer guest entry when an asynchronous exception is pending
  KVM: arm64: Add kvm_extable for vaxorcism code
  mm: slub: fix conversion of freelist_corrupted()
  dm thin metadata: Avoid returning cmd->bm wild pointer on error
  dm cache metadata: Avoid returning cmd->bm wild pointer on error
  libata: implement ATA_HORKAGE_MAX_TRIM_128M and apply to Sandisks
  block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into <linux/blkdev.h>
  block: allow for_each_bvec to support zero len bvec
  affs: fix basic permission bits to actually work
  ALSA: firewire-digi00x: exclude Avid Adrenaline from detection
  ALSA: hda/hdmi: always check pin power status in i915 pin fixup
  ALSA: pcm: oss: Remove superfluous WARN_ON() for mulaw sanity check
  ALSA: ca0106: fix error code handling
  usb: qmi_wwan: add D-Link DWM-222 A2 device ID
  net: usb: qmi_wwan: add Telit 0x1050 composition
  btrfs: fix potential deadlock in the search ioctl
  uaccess: Add non-pagefault user-space write function
  uaccess: Add non-pagefault user-space read functions
  btrfs: set the lockdep class for log tree extent buffers
  btrfs: Remove extraneous extent_buffer_get from tree_mod_log_rewind
  btrfs: Remove redundant extent_buffer_get in get_old_root
  btrfs: drop path before adding new uuid tree entry
  include/linux/log2.h: add missing () around n in roundup_pow_of_two()
  thermal: ti-soc-thermal: Fix bogus thermal shutdowns for omap4430
  iommu/vt-d: Serialize IOMMU GCMD register modifications
  tg3: Fix soft lockup when tg3_reset_task() fails.
  fix regression in "epoll: Keep a reference on files added to the check list"
  net: ethernet: mlx4: Fix memory allocation in mlx4_buddy_init()
  perf tools: Correct SNOOPX field offset
  nvmet-fc: Fix a missed _irqsave version of spin_lock in 'nvmet_fc_fod_op_done()'
  bnxt_en: Fix PCI AER error recovery flow
  bnxt_en: Check for zero dir entries in NVRAM.
  gtp: add GTPA_LINK info to msg sent to userspace
  dmaengine: pl330: Fix burst length if burst size is smaller than bus width
  net: arc_emac: Fix memleak in arc_mdio_probe
  ravb: Fixed to be able to unload modules
  net: systemport: Fix memleak in bcm_sysport_probe
  net: hns: Fix memleak in hns_nic_dev_probe
  netfilter: nf_tables: fix destination register zeroing
  netfilter: nf_tables: incorrect enum nft_list_attributes definition
  netfilter: nf_tables: add NFTA_SET_USERDATA if not null
  MIPS: BMIPS: Also call bmips_cpu_setup() for secondary cores
  MIPS: mm: BMIPS5000 has inclusive physical caches
  dmaengine: at_hdmac: check return value of of_find_device_by_node() in at_dma_xlate()
  batman-adv: bla: use netif_rx_ni when not in interrupt context
  batman-adv: Fix own OGM check in aggregated OGMs
  batman-adv: Avoid uninitialized chaddr when handling DHCP
  dmaengine: of-dma: Fix of_dma_router_xlate's of_dma_xlate handling
  xen/xenbus: Fix granting of vmalloc'd memory
  s390: don't trace preemption in percpu macros
  cpuidle: Fixup IRQ state
  ceph: don't allow setlease on cephfs
  nvmet: Disable keep-alive timer when kato is cleared to 0h
  hwmon: (applesmc) check status earlier.
  drm/msm: add shutdown support for display platform_driver
  perf record/stat: Explicitly call out event modifiers in the documentation
  HID: core: Sanitize event code and type when mapping input
  HID: core: Correctly handle ReportSize being zero
  Linux 4.14.196
  ALSA: usb-audio: Update documentation comment for MS2109 quirk
  HID: hiddev: Fix slab-out-of-bounds write in hiddev_ioctl_usage()
  tpm: Unify the mismatching TPM space buffer sizes
  btrfs: check the right error variable in btrfs_del_dir_entries_in_log
  usb: storage: Add unusual_uas entry for Sony PSZ drives
  USB: cdc-acm: rework notification_buffer resizing
  USB: gadget: u_f: Unbreak offset calculation in VLAs
  USB: gadget: f_ncm: add bounds checks to ncm_unwrap_ntb()
  USB: gadget: u_f: add overflow checks to VLA macros
  overflow.h: Add allocation size calculation helpers
  usb: host: ohci-exynos: Fix error handling in exynos_ohci_probe()
  USB: Ignore UAS for JMicron JMS567 ATA/ATAPI Bridge
  USB: quirks: Add no-lpm quirk for another Raydium touchscreen
  usb: uas: Add quirk for PNY Pro Elite
  USB: yurex: Fix bad gfp argument
  drm/amdgpu: Fix buffer overflow in INFO ioctl
  device property: Fix the secondary firmware node handling in set_primary_fwnode()
  PM: sleep: core: Fix the handling of pending runtime resume requests
  xhci: Do warm-reset when both CAS and XDEV_RESUME are set
  XEN uses irqdesc::irq_data_common::handler_data to store a per interrupt XEN data pointer which contains XEN specific information.
  writeback: Fix sync livelock due to b_dirty_time processing
  writeback: Avoid skipping inode writeback
  writeback: Protect inode->i_io_list with inode->i_lock
  serial: 8250: change lock order in serial8250_do_startup()
  serial: 8250_exar: Fix number of ports for Commtech PCIe cards
  serial: pl011: Don't leak amba_ports entry on driver register error
  serial: pl011: Fix oops on -EPROBE_DEFER
  serial: samsung: Removes the IRQ not found warning
  vt_ioctl: change VT_RESIZEX ioctl to check for error return from vc_resize()
  vt: defer kfree() of vc_screenbuf in vc_do_resize()
  USB: lvtest: return proper error code in probe
  fbcon: prevent user font height or width change from causing potential out-of-bounds access
  btrfs: fix space cache memory leak after transaction abort
  HID: i2c-hid: Always sleep 60ms after I2C_HID_PWR_ON commands
  powerpc/perf: Fix soft lockups due to missed interrupt accounting
  net: gianfar: Add of_node_put() before goto statement
  scsi: ufs: Clean up completed request without interrupt notification
  scsi: ufs: Improve interrupt handling for shared interrupts
  scsi: ufs: Fix possible infinite loop in ufshcd_hold
  s390/cio: add cond_resched() in the slow_eval_known_fn() loop
  spi: stm32: fix stm32_spi_prepare_mbr in case of odd clk_rate
  fs: prevent BUG_ON in submit_bh_wbc()
  jbd2: abort journal if free a async write error metadata buffer
  ext4: don't BUG on inconsistent journal feature
  jbd2: make sure jh have b_transaction set in refile/unfile_buffer
  usb: gadget: f_tcm: Fix some resource leaks in some error paths
  i2c: rcar: in slave mode, clear NACK earlier
  null_blk: fix passing of REQ_FUA flag in null_handle_rq
  nvme-fc: Fix wrong return value in __nvme_fc_init_request()
  media: gpio-ir-tx: improve precision of transmitted signal due to scheduling
  Revert "ath10k: fix DMA related firmware crashes on multiple devices"
  efi: provide empty efi_enter_virtual_mode implementation
  USB: sisusbvga: Fix a potential UB casued by left shifting a negative value
  powerpc/spufs: add CONFIG_COREDUMP dependency
  KVM: arm64: Fix symbol dependency in __hyp_call_panic_nvhe
  media: davinci: vpif_capture: fix potential double free
  EDAC/ie31200: Fallback if host bridge device is already initialized
  scsi: fcoe: Memory leak fix in fcoe_sysfs_fcf_del()
  ceph: fix potential mdsc use-after-free crash
  scsi: iscsi: Do not put host in iscsi_set_flashnode_param()
  locking/lockdep: Fix overflow in presentation of average lock-time
  drm/nouveau: Fix reference count leak in nouveau_connector_detect
  drm/nouveau/drm/noveau: fix reference count leak in nouveau_fbcon_open
  f2fs: fix use-after-free issue
  cec-api: prevent leaking memory through hole in structure
  mips/vdso: Fix resource leaks in genvdso.c
  rtlwifi: rtl8192cu: Prevent leaking urb
  PCI: Fix pci_create_slot() reference count leak
  omapfb: fix multiple reference count leaks due to pm_runtime_get_sync
  selftests/powerpc: Purge extra count_pmc() calls of ebb selftests
  scsi: lpfc: Fix shost refcount mismatch when deleting vport
  drm/amdgpu/display: fix ref count leak when pm_runtime_get_sync fails
  drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config
  drm/amd/display: fix ref count leak in amdgpu_drm_ioctl
  drm/amdgpu: fix ref count leak in amdgpu_driver_open_kms
  drm/radeon: fix multiple reference count leak
  drm/amdkfd: Fix reference count leaks.
  iommu/iova: Don't BUG on invalid PFNs
  scsi: target: tcmu: Fix crash on ARM during cmd completion
  blktrace: ensure our debugfs dir exists
  media: pci: ttpci: av7110: fix possible buffer overflow caused by bad DMA value in debiirq()
  powerpc/xive: Ignore kmemleak false positives
  arm64: dts: qcom: msm8916: Pull down PDM GPIOs during sleep
  mfd: intel-lpss: Add Intel Emmitsburg PCH PCI IDs
  ASoC: tegra: Fix reference count leaks.
  ALSA: pci: delete repeated words in comments
  gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY
  ipvlan: fix device features
  tipc: fix uninit skb->data in tipc_nl_compat_dumpit()
  net: Fix potential wrong skb->protocol in skb_vlan_untag()
  powerpc/64s: Don't init FSCR_DSCR in __init_FSCR()
  ANDROID: cuttlefish_defconfig: initialize locals with zeroes
  BACKPORT: security: allow using Clang's zero initialization for stack variables
  Revert "binder: Prevent context manager from incrementing ref 0"
  Linux 4.14.195
  KVM: arm/arm64: Don't reschedule in unmap_stage2_range()
  clk: Evict unregistered clks from parent caches
  xen: don't reschedule in preemption off sections
  mm/hugetlb: fix calculation of adjust_range_if_pmd_sharing_possible
  do_epoll_ctl(): clean the failure exits up a bit
  epoll: Keep a reference on files added to the check list
  powerpc/pseries: Do not initiate shutdown when system is running on UPS
  net: dsa: b53: check for timeout
  hv_netvsc: Fix the queue_mapping in netvsc_vf_xmit()
  bonding: fix active-backup failover for current ARP slave
  vfio/type1: Add proper error unwind for vfio_iommu_replay()
  ASoC: intel: Fix memleak in sst_media_open
  ASoC: msm8916-wcd-analog: fix register Interrupt offset
  bonding: fix a potential double-unregister
  bonding: show saner speed for broadcast mode
  net: fec: correct the error path for regulator disable in probe
  i40e: Fix crash during removing i40e driver
  i40e: Set RX_ONLY mode for unicast promiscuous on VLAN
  ext4: fix potential negative array index in do_split()
  alpha: fix annotation of io{read,write}{16,32}be()
  xfs: Fix UBSAN null-ptr-deref in xfs_sysfs_init
  virtio_ring: Avoid loop when vq is broken in virtqueue_poll
  scsi: libfc: Free skb in fc_disc_gpn_id_resp() for valid cases
  cpufreq: intel_pstate: Fix cpuinfo_max_freq when MSR_TURBO_RATIO_LIMIT is 0
  jffs2: fix UAF problem
  xfs: fix inode quota reservation checks
  m68knommu: fix overwriting of bits in ColdFire V3 cache control
  Input: psmouse - add a newline when printing 'proto' by sysfs
  media: vpss: clean up resources in init
  rtc: goldfish: Enable interrupt in set_alarm() when necessary
  media: budget-core: Improve exception handling in budget_register()
  scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
  spi: Prevent adding devices below an unregistering controller
  jbd2: add the missing unlock_buffer() in the error path of jbd2_write_superblock()
  ext4: fix checking of directory entry validity for inline directories
  mm, page_alloc: fix core hung in free_pcppages_bulk()
  mm: include CMA pages in lowmem_reserve at boot
  kernel/relay.c: fix memleak on destroy relay channel
  romfs: fix uninitialized memory leak in romfs_dev_read()
  btrfs: sysfs: use NOFS for device creation
  btrfs: inode: fix NULL pointer dereference if inode doesn't need compression
  btrfs: Move free_pages_out label in inline extent handling branch in compress_file_range
  btrfs: don't show full path of bind mounts in subvol=
  btrfs: export helpers for subvolume name/id resolution
  powerpc: Allow 4224 bytes of stack expansion for the signal frame
  powerpc/mm: Only read faulting instruction when necessary in do_page_fault()
  khugepaged: adjust VM_BUG_ON_MM() in __khugepaged_enter()
  khugepaged: khugepaged_test_exit() check mmget_still_valid()
  perf probe: Fix memory leakage when the probe point is not found
  drm/vgem: Replace opencoded version of drm_gem_dumb_map_offset()
  ANDROID: virtio_gpu.h: move map/unmap to 3d group
  Linux 4.14.194
  dm cache: remove all obsolete writethrough-specific code
  dm cache: submit writethrough writes in parallel to origin and cache
  dm cache: pass cache structure to mode functions
  genirq/affinity: Make affinity setting if activated opt-in
  genirq/affinity: Handle affinity setting on inactive interrupts correctly
  khugepaged: retract_page_tables() remember to test exit
  sh: landisk: Add missing initialization of sh_io_port_base
  tools build feature: Quote CC and CXX for their arguments
  perf bench mem: Always memset source before memcpy
  ALSA: echoaudio: Fix potential Oops in snd_echo_resume()
  mfd: dln2: Run event handler loop under spinlock
  test_kmod: avoid potential double free in trigger_config_run_type()
  fs/ufs: avoid potential u32 multiplication overflow
  nfs: Fix getxattr kernel panic and memory overflow
  net: qcom/emac: add missed clk_disable_unprepare in error path of emac_clks_phase1_init
  drm/vmwgfx: Fix two list_for_each loop exit tests
  drm/vmwgfx: Use correct vmw_legacy_display_unit pointer
  Input: sentelic - fix error return when fsp_reg_write fails
  i2c: rcar: avoid race when unregistering slave
  tools build feature: Use CC and CXX from parent
  pwm: bcm-iproc: handle clk_get_rate() return
  clk: clk-atlas6: fix return value check in atlas6_clk_init()
  i2c: rcar: slave: only send STOP event when we have been addressed
  iommu/vt-d: Enforce PASID devTLB field mask
  iommu/omap: Check for failure of a call to omap_iommu_dump_ctx
  dm rq: don't call blk_mq_queue_stopped() in dm_stop_queue()
  gpu: ipu-v3: image-convert: Combine rotate/no-rotate irq handlers
  USB: serial: ftdi_sio: clean up receive processing
  USB: serial: ftdi_sio: make process-packet buffer unsigned
  RDMA/ipoib: Return void from ipoib_ib_dev_stop()
  mfd: arizona: Ensure 32k clock is put on driver unbind and error
  drm/imx: imx-ldb: Disable both channels for split mode in enc->disable()
  perf intel-pt: Fix FUP packet state
  pseries: Fix 64 bit logical memory block panic
  watchdog: f71808e_wdt: clear watchdog timeout occurred flag
  watchdog: f71808e_wdt: remove use of wrong watchdog_info option
  watchdog: f71808e_wdt: indicate WDIOF_CARDRESET support in watchdog_info.options
  tracing: Use trace_sched_process_free() instead of exit() for pid tracing
  tracing/hwlat: Honor the tracing_cpumask
  kprobes: Fix NULL pointer dereference at kprobe_ftrace_handler
  ftrace: Setup correct FTRACE_FL_REGS flags for module
  ocfs2: change slot number type s16 to u16
  ext2: fix missing percpu_counter_inc
  MIPS: CPU#0 is not hotpluggable
  mac80211: fix misplaced while instead of if
  bcache: allocate meta data pages as compound pages
  md/raid5: Fix Force reconstruct-write io stuck in degraded raid5
  net/compat: Add missing sock updates for SCM_RIGHTS
  net: stmmac: dwmac1000: provide multicast filter fallback
  net: ethernet: stmmac: Disable hardware multicast filter
  powerpc: Fix circular dependency between percpu.h and mmu.h
  xtensa: fix xtensa_pmu_setup prototype
  iio: dac: ad5592r: fix unbalanced mutex unlocks in ad5592r_read_raw()
  dt-bindings: iio: io-channel-mux: Fix compatible string in example code
  btrfs: fix memory leaks after failure to lookup checksums during inode logging
  btrfs: only search for left_info if there is no right_info in try_merge_free_space
  btrfs: don't allocate anonymous block device for user invisible roots
  PCI: hotplug: ACPI: Fix context refcounting in acpiphp_grab_context()
  smb3: warn on confusing error scenario with sec=krb5
  net: initialize fastreuse on inet_inherit_port
  xen/balloon: make the balloon wait interruptible
  xen/balloon: fix accounting in alloc_xenballooned_pages error path
  irqdomain/treewide: Free firmware node after domain removal
  ARM: 8992/1: Fix unwind_frame for clang-built kernels
  parisc: mask out enable and reserved bits from sba imask
  parisc: Implement __smp_store_release and __smp_load_acquire barriers
  mtd: rawnand: qcom: avoid write to unavailable register
  spi: spidev: Align buffers for DMA
  9p: Fix memory leak in v9fs_mount
  ALSA: usb-audio: work around streaming quirk for MacroSilicon MS2109
  fs/minix: reject too-large maximum file size
  fs/minix: don't allow getting deleted inodes
  fs/minix: check return value of sb_getblk()
  bitfield.h: don't compile-time validate _val in FIELD_FIT
  crypto: cpt - don't sleep of CRYPTO_TFM_REQ_MAY_SLEEP was not specified
  crypto: ccp - Fix use of merged scatterlists
  crypto: qat - fix double free in qat_uclo_create_batch_init_list
  ALSA: usb-audio: add quirk for Pioneer DDJ-RB
  ALSA: usb-audio: fix overeager device match for MacroSilicon MS2109
  ALSA: usb-audio: Creative USB X-Fi Pro SB1095 volume knob support
  USB: serial: cp210x: enable usb generic throttle/unthrottle
  USB: serial: cp210x: re-enable auto-RTS on open
  net: Set fput_needed iff FDPUT_FPUT is set
  net: refactor bind_bucket fastreuse into helper
  net/nfc/rawsock.c: add CAP_NET_RAW check.
  drivers/net/wan/lapbether: Added needed_headroom and a skb->len check
  af_packet: TPACKET_V3: fix fill status rwlock imbalance
  crypto: aesni - add compatibility with IAS
  x86/fsgsbase/64: Fix NULL deref in 86_fsgsbase_read_task
  pinctrl-single: fix pcs_parse_pinconf() return value
  dlm: Fix kobject memleak
  fsl/fman: fix eth hash table allocation
  fsl/fman: check dereferencing null pointer
  fsl/fman: fix unreachable code
  fsl/fman: fix dereference null return value
  fsl/fman: use 32-bit unsigned integer
  net: spider_net: Fix the size used in a 'dma_free_coherent()' call
  liquidio: Fix wrong return value in cn23xx_get_pf_num()
  net: ethernet: aquantia: Fix wrong return value
  tools, build: Propagate build failures from tools/build/Makefile.build
  wl1251: fix always return 0 error
  s390/qeth: don't process empty bridge port events
  selftests/powerpc: Fix online CPU selection
  PCI: Release IVRS table in AMD ACS quirk
  selftests/powerpc: Fix CPU affinity for child process
  Bluetooth: hci_serdev: Only unregister device if it was registered
  power: supply: check if calc_soc succeeded in pm860x_init_battery
  Smack: prevent underflow in smk_set_cipso()
  Smack: fix another vsscanf out of bounds
  net: dsa: mv88e6xxx: MV88E6097 does not support jumbo configuration
  scsi: mesh: Fix panic after host or bus reset
  usb: dwc2: Fix error path in gadget registration
  MIPS: OCTEON: add missing put_device() call in dwc3_octeon_device_init()
  coresight: tmc: Fix TMC mode read in tmc_read_unprepare_etb()
  thermal: ti-soc-thermal: Fix reversed condition in ti_thermal_expose_sensor()
  USB: serial: iuu_phoenix: fix led-activity helpers
  drm/imx: tve: fix regulator_disable error path
  PCI/ASPM: Add missing newline in sysfs 'policy'
  staging: rtl8192u: fix a dubious looking mask before a shift
  powerpc/vdso: Fix vdso cpu truncation
  mwifiex: Prevent memory corruption handling keys
  scsi: scsi_debug: Add check for sdebug_max_queue during module init
  drm/bridge: sil_sii8620: initialize return of sii8620_readb
  drm: panel: simple: Fix bpc for LG LB070WV8 panel
  leds: core: Flush scheduled work for system suspend
  PCI: Fix pci_cfg_wait queue locking problem
  xfs: fix reflink quota reservation accounting error
  media: exynos4-is: Add missed check for pinctrl_lookup_state()
  media: firewire: Using uninitialized values in node_probe()
  ipvs: allow connection reuse for unconfirmed conntrack
  scsi: eesox: Fix different dev_id between request_irq() and free_irq()
  scsi: powertec: Fix different dev_id between request_irq() and free_irq()
  drm/radeon: fix array out-of-bounds read and write issues
  cxl: Fix kobject memleak
  drm/mipi: use dcs write for mipi_dsi_dcs_set_tear_scanline
  scsi: cumana_2: Fix different dev_id between request_irq() and free_irq()
  ASoC: Intel: bxt_rt298: add missing .owner field
  media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()
  leds: lm355x: avoid enum conversion warning
  drm/arm: fix unintentional integer overflow on left shift
  iio: improve IIO_CONCENTRATION channel type description
  video: pxafb: Fix the function used to balance a 'dma_alloc_coherent()' call
  console: newport_con: fix an issue about leak related system resources
  video: fbdev: sm712fb: fix an issue about iounmap for a wrong address
  agp/intel: Fix a memory leak on module initialisation failure
  ACPICA: Do not increment operation_region reference counts for field units
  bcache: fix super block seq numbers comparision in register_cache_set()
  dyndbg: fix a BUG_ON in ddebug_describe_flags
  usb: bdc: Halt controller on suspend
  bdc: Fix bug causing crash after multiple disconnects
  usb: gadget: net2280: fix memory leak on probe error handling paths
  gpu: host1x: debug: Fix multiple channels emitting messages simultaneously
  iwlegacy: Check the return value of pcie_capability_read_*()
  brcmfmac: set state of hanger slot to FREE when flushing PSQ
  brcmfmac: To fix Bss Info flag definition Bug
  mm/mmap.c: Add cond_resched() for exit_mmap() CPU stalls
  irqchip/irq-mtk-sysirq: Replace spinlock with raw_spinlock
  drm/debugfs: fix plain echo to connector "force" attribute
  drm/nouveau: fix multiple instances of reference count leaks
  arm64: dts: hisilicon: hikey: fixes to comply with adi, adv7533 DT binding
  md-cluster: fix wild pointer of unlock_all_bitmaps()
  video: fbdev: neofb: fix memory leak in neo_scan_monitor()
  drm/radeon: Fix reference count leaks caused by pm_runtime_get_sync
  fs/btrfs: Add cond_resched() for try_release_extent_mapping() stalls
  Bluetooth: add a mutex lock to avoid UAF in do_enale_set
  drm/tilcdc: fix leak & null ref in panel_connector_get_modes
  ARM: socfpga: PM: add missing put_device() call in socfpga_setup_ocram_self_refresh()
  spi: lantiq: fix: Rx overflow error in full duplex mode
  ARM: at91: pm: add missing put_device() call in at91_pm_sram_init()
  platform/x86: intel-vbtn: Fix return value check in check_acpi_dev()
  platform/x86: intel-hid: Fix return value check in check_acpi_dev()
  m68k: mac: Fix IOP status/control register writes
  m68k: mac: Don't send IOP message until channel is idle
  arm64: dts: exynos: Fix silent hang after boot on Espresso
  arm64: dts: qcom: msm8916: Replace invalid bias-pull-none property
  EDAC: Fix reference count leaks
  arm64: dts: rockchip: fix rk3399-puma gmac reset gpio
  arm64: dts: rockchip: fix rk3399-puma vcc5v0-host gpio
  sched: correct SD_flags returned by tl->sd_flags()
  x86/mce/inject: Fix a wrong assignment of i_mce.status
  cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone()
  HID: input: Fix devices that return multiple bytes in battery report
  tracepoint: Mark __tracepoint_string's __used
  Smack: fix use-after-free in smk_write_relabel_self()
  rxrpc: Fix race between recvmsg and sendmsg on immediate call failure
  usb: hso: check for return value in hso_serial_common_create()
  selftests/net: relax cpu affinity requirement in msg_zerocopy test
  Revert "vxlan: fix tos value before xmit"
  openvswitch: Prevent kernel-infoleak in ovs_ct_put_key()
  net: gre: recompute gre csum for sctp over gre tunnels
  hv_netvsc: do not use VF device if link is down
  net: lan78xx: replace bogus endpoint lookup
  vxlan: Ensure FDB dump is performed under RCU
  net: ethernet: mtk_eth_soc: fix MTU warnings
  ipv6: fix memory leaks on IPV6_ADDRFORM path
  ipv4: Silence suspicious RCU usage warning
  xattr: break delegations in {set,remove}xattr
  Drivers: hv: vmbus: Ignore CHANNELMSG_TL_CONNECT_RESULT(23)
  tools lib traceevent: Fix memory leak in process_dynamic_array_len
  atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent
  igb: reinit_locked() should be called with rtnl_lock
  cfg80211: check vendor command doit pointer before use
  i2c: slave: add sanity check when unregistering
  i2c: slave: improve sanity check when registering
  drm/nouveau/fbcon: zero-initialise the mode_cmd2 structure
  drm/nouveau/fbcon: fix module unload when fbcon init has failed for some reason
  net/9p: validate fds in p9_fd_open
  leds: 88pm860x: fix use-after-free on unbind
  leds: lm3533: fix use-after-free on unbind
  leds: da903x: fix use-after-free on unbind
  leds: wm831x-status: fix use-after-free on unbind
  mtd: properly check all write ioctls for permissions
  vgacon: Fix for missing check in scrollback handling
  binder: Prevent context manager from incrementing ref 0
  omapfb: dss: Fix max fclk divider for omap36xx
  Bluetooth: Prevent out-of-bounds read in hci_inquiry_result_with_rssi_evt()
  Bluetooth: Prevent out-of-bounds read in hci_inquiry_result_evt()
  Bluetooth: Fix slab-out-of-bounds read in hci_extended_inquiry_result_evt()
  staging: android: ashmem: Fix lockdep warning for write operation
  ALSA: seq: oss: Serialize ioctls
  usb: xhci: Fix ASMedia ASM1142 DMA addressing
  usb: xhci: define IDs for various ASMedia host controllers
  USB: iowarrior: fix up report size handling for some devices
  net/mlx5e: Don't support phys switch id if not in switchdev mode
  USB: serial: qcserial: add EM7305 QDL product ID
  ANDROID: tty: fix tty name overflow
  ANDROID: fix a bug in quota2
  ANDROID: Incremental fs: fix magic compatibility again
  Linux 4.14.193
  ARM: 8702/1: head-common.S: Clear lr before jumping to start_kernel()
  ext4: fix direct I/O read error
  random32: move the pseudo-random 32-bit definitions to prandom.h
  random32: remove net_rand_state from the latent entropy gcc plugin
  random: fix circular include dependency on arm64 after addition of percpu.h
  ARM: percpu.h: fix build error
  random32: update the net random state on interrupt and activity
  Revert "scsi: libsas: direct call probe and destruct"
  Linux 4.14.192
  x86/i8259: Use printk_deferred() to prevent deadlock
  KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled
  xen-netfront: fix potential deadlock in xennet_remove()
  cxgb4: add missing release on skb in uld_send()
  x86/unwind/orc: Fix ORC for newly forked tasks
  Revert "i2c: cadence: Fix the hold bit setting"
  net: ethernet: ravb: exit if re-initialization fails in tx timeout
  parisc: add support for cmpxchg on u8 pointers
  nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frame
  qed: Disable "MFW indication via attention" SPAM every 5 minutes
  usb: hso: Fix debug compile warning on sparc32
  arm64: csum: Fix handling of bad packets
  arm64/alternatives: move length validation inside the subsection
  mac80211: mesh: Free pending skb when destroying a mpath
  mac80211: mesh: Free ie data when leaving mesh
  bpf: Fix map leak in HASH_OF_MAPS map
  ibmvnic: Fix IRQ mapping disposal in error path
  mlxsw: core: Free EMAD transactions using kfree_rcu()
  mlxsw: core: Increase scope of RCU read-side critical section
  mlx4: disable device on shutdown
  net: lan78xx: fix transfer-buffer memory leak
  net: lan78xx: add missing endpoint sanity check
  sh: Fix validation of system call number
  selftests/net: rxtimestamp: fix clang issues for target arch PowerPC
  net/x25: Fix null-ptr-deref in x25_disconnect
  net/x25: Fix x25_neigh refcnt leak when x25 disconnect
  xfs: fix missed wakeup on l_flush_wait
  rds: Prevent kernel-infoleak in rds_notify_queue_get()
  x86, vmlinux.lds: Page-align end of ..page_aligned sections
  x86/build/lto: Fix truncated .bss with -fdata-sections
  9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work
  9p/trans_fd: abort p9_read_work if req status changed
  f2fs: check if file namelen exceeds max value
  f2fs: check memory boundary by insane namelen
  drm: hold gem reference until object is no longer accessed
  drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()
  ARM: 8986/1: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints
  wireless: Use offsetof instead of custom macro.
  PCI/ASPM: Disable ASPM on ASMedia ASM1083/1085 PCIe-to-PCI bridge
  x86/kvm: Be careful not to clear KVM_VCPU_FLUSH_TLB bit
  ath9k: release allocated buffer if timed out
  ath9k_htc: release allocated buffer if timed out
  iio: imu: adis16400: fix memory leak
  media: rc: prevent memory leak in cx23888_ir_probe
  crypto: ccp - Release all allocated memory if sha type is invalid
  net: phy: mdio-bcm-unimac: fix potential NULL dereference in unimac_mdio_probe()
  scsi: libsas: direct call probe and destruct
  Linux 4.14.191
  xfs: set format back to extents if xfs_bmap_extents_to_btree
  regmap: debugfs: check count when read regmap file
  mm/page_owner.c: remove drain_all_pages from init_early_allocated_pages
  tcp: allow at most one TLP probe per flight
  rtnetlink: Fix memory(net_device) leak when ->newlink fails
  ip6_gre: fix null-ptr-deref in ip6gre_init_net()
  AX.25: Prevent integer overflows in connect and sendmsg
  rxrpc: Fix sendmsg() returning EPIPE due to recvmsg() returning ENODATA
  net: udp: Fix wrong clean up for IS_UDPLITE macro
  net-sysfs: add a newline when printing 'tx_timeout' by sysfs
  drivers/net/wan/x25_asy: Fix to make it work
  dev: Defer free of skbs in flush_backlog
  AX.25: Prevent out-of-bounds read in ax25_sendmsg()
  AX.25: Fix out-of-bounds read in ax25_connect()

 Conflicts:
	drivers/clk/clk.c
	drivers/gpu/drm/msm/msm_drv.c
	drivers/hwtracing/coresight/coresight-tmc-etf.c

 Fixed build errors:
	drivers/md/dm-bow.c

Change-Id: Ia70efae18753ba5dbb3b67e00201e2c12eac5e70
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2020-09-18 12:43:35 +05:30
Greg Kroah-Hartman
aaa9fead2d Merge 4.14.196 into android-4.14-stable
Changes in 4.14.196
	powerpc/64s: Don't init FSCR_DSCR in __init_FSCR()
	net: Fix potential wrong skb->protocol in skb_vlan_untag()
	tipc: fix uninit skb->data in tipc_nl_compat_dumpit()
	ipvlan: fix device features
	gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY
	ALSA: pci: delete repeated words in comments
	ASoC: tegra: Fix reference count leaks.
	mfd: intel-lpss: Add Intel Emmitsburg PCH PCI IDs
	arm64: dts: qcom: msm8916: Pull down PDM GPIOs during sleep
	powerpc/xive: Ignore kmemleak false positives
	media: pci: ttpci: av7110: fix possible buffer overflow caused by bad DMA value in debiirq()
	blktrace: ensure our debugfs dir exists
	scsi: target: tcmu: Fix crash on ARM during cmd completion
	iommu/iova: Don't BUG on invalid PFNs
	drm/amdkfd: Fix reference count leaks.
	drm/radeon: fix multiple reference count leak
	drm/amdgpu: fix ref count leak in amdgpu_driver_open_kms
	drm/amd/display: fix ref count leak in amdgpu_drm_ioctl
	drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config
	drm/amdgpu/display: fix ref count leak when pm_runtime_get_sync fails
	scsi: lpfc: Fix shost refcount mismatch when deleting vport
	selftests/powerpc: Purge extra count_pmc() calls of ebb selftests
	omapfb: fix multiple reference count leaks due to pm_runtime_get_sync
	PCI: Fix pci_create_slot() reference count leak
	rtlwifi: rtl8192cu: Prevent leaking urb
	mips/vdso: Fix resource leaks in genvdso.c
	cec-api: prevent leaking memory through hole in structure
	f2fs: fix use-after-free issue
	drm/nouveau/drm/noveau: fix reference count leak in nouveau_fbcon_open
	drm/nouveau: Fix reference count leak in nouveau_connector_detect
	locking/lockdep: Fix overflow in presentation of average lock-time
	scsi: iscsi: Do not put host in iscsi_set_flashnode_param()
	ceph: fix potential mdsc use-after-free crash
	scsi: fcoe: Memory leak fix in fcoe_sysfs_fcf_del()
	EDAC/ie31200: Fallback if host bridge device is already initialized
	media: davinci: vpif_capture: fix potential double free
	KVM: arm64: Fix symbol dependency in __hyp_call_panic_nvhe
	powerpc/spufs: add CONFIG_COREDUMP dependency
	USB: sisusbvga: Fix a potential UB casued by left shifting a negative value
	efi: provide empty efi_enter_virtual_mode implementation
	Revert "ath10k: fix DMA related firmware crashes on multiple devices"
	media: gpio-ir-tx: improve precision of transmitted signal due to scheduling
	nvme-fc: Fix wrong return value in __nvme_fc_init_request()
	null_blk: fix passing of REQ_FUA flag in null_handle_rq
	i2c: rcar: in slave mode, clear NACK earlier
	usb: gadget: f_tcm: Fix some resource leaks in some error paths
	jbd2: make sure jh have b_transaction set in refile/unfile_buffer
	ext4: don't BUG on inconsistent journal feature
	jbd2: abort journal if free a async write error metadata buffer
	fs: prevent BUG_ON in submit_bh_wbc()
	spi: stm32: fix stm32_spi_prepare_mbr in case of odd clk_rate
	s390/cio: add cond_resched() in the slow_eval_known_fn() loop
	scsi: ufs: Fix possible infinite loop in ufshcd_hold
	scsi: ufs: Improve interrupt handling for shared interrupts
	scsi: ufs: Clean up completed request without interrupt notification
	net: gianfar: Add of_node_put() before goto statement
	powerpc/perf: Fix soft lockups due to missed interrupt accounting
	HID: i2c-hid: Always sleep 60ms after I2C_HID_PWR_ON commands
	btrfs: fix space cache memory leak after transaction abort
	fbcon: prevent user font height or width change from causing potential out-of-bounds access
	USB: lvtest: return proper error code in probe
	vt: defer kfree() of vc_screenbuf in vc_do_resize()
	vt_ioctl: change VT_RESIZEX ioctl to check for error return from vc_resize()
	serial: samsung: Removes the IRQ not found warning
	serial: pl011: Fix oops on -EPROBE_DEFER
	serial: pl011: Don't leak amba_ports entry on driver register error
	serial: 8250_exar: Fix number of ports for Commtech PCIe cards
	serial: 8250: change lock order in serial8250_do_startup()
	writeback: Protect inode->i_io_list with inode->i_lock
	writeback: Avoid skipping inode writeback
	writeback: Fix sync livelock due to b_dirty_time processing
	XEN uses irqdesc::irq_data_common::handler_data to store a per interrupt XEN data pointer which contains XEN specific information.
	xhci: Do warm-reset when both CAS and XDEV_RESUME are set
	PM: sleep: core: Fix the handling of pending runtime resume requests
	device property: Fix the secondary firmware node handling in set_primary_fwnode()
	drm/amdgpu: Fix buffer overflow in INFO ioctl
	USB: yurex: Fix bad gfp argument
	usb: uas: Add quirk for PNY Pro Elite
	USB: quirks: Add no-lpm quirk for another Raydium touchscreen
	USB: Ignore UAS for JMicron JMS567 ATA/ATAPI Bridge
	usb: host: ohci-exynos: Fix error handling in exynos_ohci_probe()
	overflow.h: Add allocation size calculation helpers
	USB: gadget: u_f: add overflow checks to VLA macros
	USB: gadget: f_ncm: add bounds checks to ncm_unwrap_ntb()
	USB: gadget: u_f: Unbreak offset calculation in VLAs
	USB: cdc-acm: rework notification_buffer resizing
	usb: storage: Add unusual_uas entry for Sony PSZ drives
	btrfs: check the right error variable in btrfs_del_dir_entries_in_log
	tpm: Unify the mismatching TPM space buffer sizes
	HID: hiddev: Fix slab-out-of-bounds write in hiddev_ioctl_usage()
	ALSA: usb-audio: Update documentation comment for MS2109 quirk
	Linux 4.14.196

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I14bae9c97fe9e2e31182c3426df57e5db5fcab8d
2020-09-03 12:02:51 +02:00
Xianting Tian
1517868cac fs: prevent BUG_ON in submit_bh_wbc()
[ Upstream commit 377254b2cd2252c7c3151b113cbdf93a7736c2e9 ]

If a device is hot-removed --- for example, when a physical device is
unplugged from pcie slot or a nbd device's network is shutdown ---
this can result in a BUG_ON() crash in submit_bh_wbc().  This is
because the when the block device dies, the buffer heads will have
their Buffer_Mapped flag get cleared, leading to the crash in
submit_bh_wbc.

We had attempted to work around this problem in commit a17712c8
("ext4: check superblock mapped prior to committing").  Unfortunately,
it's still possible to hit the BUG_ON(!buffer_mapped(bh)) if the
device dies between when the work-around check in ext4_commit_super()
and when submit_bh_wbh() is finally called:

Code path:
ext4_commit_super
    judge if 'buffer_mapped(sbh)' is false, return <== commit a17712c8
          lock_buffer(sbh)
          ...
          unlock_buffer(sbh)
               __sync_dirty_buffer(sbh,...
                    lock_buffer(sbh)
                        judge if 'buffer_mapped(sbh))' is false, return <== added by this patch
                            submit_bh(...,sbh)
                                submit_bh_wbc(...,sbh,...)

[100722.966497] kernel BUG at fs/buffer.c:3095! <== BUG_ON(!buffer_mapped(bh))' in submit_bh_wbc()
[100722.966503] invalid opcode: 0000 [#1] SMP
[100722.966566] task: ffff8817e15a9e40 task.stack: ffffc90024744000
[100722.966574] RIP: 0010:submit_bh_wbc+0x180/0x190
[100722.966575] RSP: 0018:ffffc90024747a90 EFLAGS: 00010246
[100722.966576] RAX: 0000000000620005 RBX: ffff8818a80603a8 RCX: 0000000000000000
[100722.966576] RDX: ffff8818a80603a8 RSI: 0000000000020800 RDI: 0000000000000001
[100722.966577] RBP: ffffc90024747ac0 R08: 0000000000000000 R09: ffff88207f94170d
[100722.966578] R10: 00000000000437c8 R11: 0000000000000001 R12: 0000000000020800
[100722.966578] R13: 0000000000000001 R14: 000000000bf9a438 R15: ffff88195f333000
[100722.966580] FS:  00007fa2eee27700(0000) GS:ffff88203d840000(0000) knlGS:0000000000000000
[100722.966580] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[100722.966581] CR2: 0000000000f0b008 CR3: 000000201a622003 CR4: 00000000007606e0
[100722.966582] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[100722.966583] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[100722.966583] PKRU: 55555554
[100722.966583] Call Trace:
[100722.966588]  __sync_dirty_buffer+0x6e/0xd0
[100722.966614]  ext4_commit_super+0x1d8/0x290 [ext4]
[100722.966626]  __ext4_std_error+0x78/0x100 [ext4]
[100722.966635]  ? __ext4_journal_get_write_access+0xca/0x120 [ext4]
[100722.966646]  ext4_reserve_inode_write+0x58/0xb0 [ext4]
[100722.966655]  ? ext4_dirty_inode+0x48/0x70 [ext4]
[100722.966663]  ext4_mark_inode_dirty+0x53/0x1e0 [ext4]
[100722.966671]  ? __ext4_journal_start_sb+0x6d/0xf0 [ext4]
[100722.966679]  ext4_dirty_inode+0x48/0x70 [ext4]
[100722.966682]  __mark_inode_dirty+0x17f/0x350
[100722.966686]  generic_update_time+0x87/0xd0
[100722.966687]  touch_atime+0xa9/0xd0
[100722.966690]  generic_file_read_iter+0xa09/0xcd0
[100722.966694]  ? page_cache_tree_insert+0xb0/0xb0
[100722.966704]  ext4_file_read_iter+0x4a/0x100 [ext4]
[100722.966707]  ? __inode_security_revalidate+0x4f/0x60
[100722.966709]  __vfs_read+0xec/0x160
[100722.966711]  vfs_read+0x8c/0x130
[100722.966712]  SyS_pread64+0x87/0xb0
[100722.966716]  do_syscall_64+0x67/0x1b0
[100722.966719]  entry_SYSCALL64_slow_path+0x25/0x25

To address this, add the check of 'buffer_mapped(bh)' to
__sync_dirty_buffer().  This also has the benefit of fixing this for
other file systems.

With this addition, we can drop the workaround in ext4_commit_supper().

[ Commit description rewritten by tytso. ]

Signed-off-by: Xianting Tian <xianting_tian@126.com>
Link: https://lore.kernel.org/r/1596211825-8750-1-git-send-email-xianting_tian@126.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-03 11:22:29 +02:00
Neeraj Soni
88205c5d99 Integrate the new file encryption framework
These changes integrate new file encryption framework to use new V2 encryption policies.

These changes were earlier reverted in 'commit 4211691d29 ("Reverting crypto and incrementalfs changes")',
as part of android-4.14.171 merge from Android common kernel. This patch attempts to bring them back
post validation.

commit a9a5450 ANDROID: dm: prevent default-key from being enabled without needed hooks
commit e1a94e6 ANDROID: dm: add dm-default-key target for metadata encryption
commit commit 232fd35 ANDROID: dm: enable may_passthrough_inline_crypto on some targets
commit 53bc059 ANDROID: dm: add support for passing through inline crypto support
commit aeed6db ANDROID: block: Introduce passthrough keyslot manager
commit 4f27c8b ANDROID: ext4, f2fs: enable direct I/O with inline encryption
commit c91db46 BACKPORT: FROMLIST: scsi: ufs: add program_key() variant op
commit f9a8e4a ANDROID: block: export symbols needed for modules to use inline crypto
commit 75fea5f ANDROID: block: fix some inline crypto bugs
commit 2871f73 ANDROID: fscrypt: add support for hardware-wrapped keys
commit bb5a657 ANDROID: block: add KSM op to derive software secret from wrapped key
commit d42ba87 ANDROID: block: provide key size as input to inline crypto APIs
commit 86646eb ANDROID: ufshcd-crypto: export cap find API
commit 83bc20e ANDROID: scsi: ufs-qcom: Enable BROKEN_CRYPTO quirk flag
commit c266a13 ANDROID: scsi: ufs: Add quirk bit for controllers that don't play well with inline crypto
commit ea09b99 ANDROID: cuttlefish_defconfig: Enable blk-crypto fallback
commit e12563c BACKPORT: FROMLIST: Update Inline Encryption from v5 to v6 of patch series
commit 8e8f55d ANDROID: scsi: ufs: UFS init should not require inline crypto
commit dae9899 ANDROID: scsi: ufs: UFS crypto variant operations API
commit a69516d ANDROID: cuttlefish_defconfig: enable inline encryption
commit b8f7b23 BACKPORT: FROMLIST: ext4: add inline encryption support
commit e64327f BACKPORT: FROMLIST: f2fs: add inline encryption support
commit a0dc8da BACKPORT: FROMLIST: fscrypt: add inline encryption support
commit 19c3c62 BACKPORT: FROMLIST: scsi: ufs: Add inline encryption support to UFS
commit f858a99 BACKPORT: FROMLIST: scsi: ufs: UFS crypto API
commit 011b834 BACKPORT: FROMLIST: scsi: ufs: UFS driver v2.1 spec crypto additions
commit ec0b569 BACKPORT: FROMLIST: block: blk-crypto for Inline Encryption
commit 760b328 ANDROID: block: Fix bio_crypt_should_process WARN_ON
commit 138adbb BACKPORT: FROMLIST: block: Add encryption context to struct bio
commit 66b5609 BACKPORT: FROMLIST: block: Keyslot Manager for Inline Encryption

Git-repo: https://android.googlesource.com/kernel/common/+/refs/heads/android-4.14-stable
Git-commit: a9a545067a
Git-commit: e1a94e6b17
Git-commit: 232fd353e4
Git-commit: 53bc059bc6
Git-commit: aeed6db424
Git-commit: 4f27c8b90b
Git-commit: c91db466b5
Git-commit: f9a8e4a5c5
Git-commit: 75fea5f605
Git-commit: 2871f73194
Git-commit: bb5a65771a
Git-commit: d42ba87e29
Git-commit: 86646ebb17
Git-commit: 83bc20ed4b
Git-commit: c266a1311e
Git-commit: ea09b9954c
Git-commit: e12563c18d
Git-commit: 8e8f55d1a7
Git-commit: dae9899044
Git-commit: a69516d091
Git-commit: b8f7b23674
Git-commit: e64327f571
Git-commit: a0dc8da519
Git-commit: 19c3c62836
Git-commit: f858a9981a
Git-commit: 011b8344c3
Git-commit: ec0b569b5c
Git-commit: 760b3283e8
Git-commit: 138adbbe5e
Git-commit: 66b5609826

Change-Id: I171d90de41185824e0c7515f3a3b43ab88f4e058
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2020-08-13 13:44:51 -07:00
Srinivasarao P
90bb7a2b24 Merge android-4.14-stable.180 (816f245) into msm-4.14
* refs/heads/tmp-816f245:
  Revert "clk: qcom: rcg2: Don't crash if our parent can't be found; return an error"
  Reverting crypto patches
  Reverting incremental fs changes
  Linux 4.14.180
  cgroup, netclassid: remove double cond_resched
  mac80211: add ieee80211_is_any_nullfunc()
  ALSA: hda: Match both PCI ID and SSID for driver blacklist
  tracing: Reverse the order of trace_types_lock and event_mutex
  sctp: Fix SHUTDOWN CTSN Ack in the peer restart case
  net: systemport: suppress warnings on failed Rx SKB allocations
  net: bcmgenet: suppress warnings on failed Rx SKB allocations
  lib/mpi: Fix building for powerpc with clang
  net: dsa: b53: Rework ARL bin logic
  scripts/config: allow colons in option strings for sed
  s390/ftrace: fix potential crashes when switching tracers
  cifs: protect updating server->dstaddr with a spinlock
  net: stmmac: Fix sub-second increment
  net: stmmac: fix enabling socfpga's ptp_ref_clock
  wimax/i2400m: Fix potential urb refcnt leak
  ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry
  ASoC: rsnd: Fix HDMI channel mapping for multi-SSI mode
  ASoC: sgtl5000: Fix VAG power-on handling
  selftests/ipc: Fix test failure seen after initial test run
  ASoC: topology: Check return value of pcm_new_ver
  powerpc/pci/of: Parse unassigned resources
  vhost: vsock: kick send_pkt worker once device is started
  ANDROID: arm64: fix a mismerge in proc.S
  Linux 4.14.179
  selinux: properly handle multiple messages in selinux_netlink_send()
  dmaengine: dmatest: Fix iteration non-stop logic
  nfs: Fix potential posix_acl refcnt leak in nfs3_set_acl
  ALSA: opti9xx: shut up gcc-10 range warning
  iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system
  scsi: target/iblock: fix WRITE SAME zeroing
  iommu/qcom: Fix local_base status check
  vfio/type1: Fix VA->PA translation for PFNMAP VMAs in vaddr_get_pfn()
  vfio: avoid possible overflow in vfio_iommu_type1_pin_pages
  RDMA/mlx4: Initialize ib_spec on the stack
  RDMA/mlx5: Set GRH fields in query QP on RoCE
  dm verity fec: fix hash block number in verity_fec_decode
  PM: hibernate: Freeze kernel threads in software_resume()
  PM: ACPI: Output correct message on target power state
  ALSA: pcm: oss: Place the plugin buffer overflow checks correctly
  ALSA: hda/hdmi: fix without unlocked before return
  ALSA: hda/realtek - Two front mics on a Lenovo ThinkCenter
  mmc: sdhci-pci: Fix eMMC driver strength for BYT-based controllers
  mmc: sdhci-xenon: fix annoying 1.8V regulator warning
  btrfs: fix partial loss of prealloc extent past i_size after fsync
  btrfs: fix block group leak when removing fails
  drm/qxl: qxl_release use after free
  drm/qxl: qxl_release leak in qxl_hw_surface_alloc()
  drm/qxl: qxl_release leak in qxl_draw_dirty_fb()
  drm/edid: Fix off-by-one in DispID DTD pixel clock
  ext4: fix special inode number checks in __ext4_iget()
  ANDROID: Incremental fs: Fix issues with very large files
  Linux 4.14.178
  propagate_one(): mnt_set_mountpoint() needs mount_lock
  ext4: check for non-zero journal inum in ext4_calculate_overhead
  qed: Fix use after free in qed_chain_free
  ext4: unsigned int compared against zero
  ext4: fix block validity checks for journal inodes using indirect blocks
  ext4: don't perform block validity checks on the journal inode
  ext4: protect journal inode's blocks using block_validity
  ext4: avoid declaring fs inconsistent due to invalid file handles
  hwmon: (jc42) Fix name to have no illegal characters
  ext4: convert BUG_ON's to WARN_ON's in mballoc.c
  ext4: increase wait time needed before reuse of deleted inode numbers
  ext4: use matching invalidatepage in ext4_writepage
  arm64: Delete the space separator in __emit_inst
  xen/xenbus: ensure xenbus_map_ring_valloc() returns proper grant status
  objtool: Support Clang non-section symbols in ORC dump
  objtool: Fix CONFIG_UBSAN_TRAP unreachable warnings
  scsi: target: fix PR IN / READ FULL STATUS for FC
  xfs: fix partially uninitialized structure in xfs_reflink_remap_extent
  x86: hyperv: report value of misc_features
  bpf, x86: Fix encoding for lower 8-bit registers in BPF_STX BPF_B
  mm: shmem: disable interrupt when acquiring info->lock in userfaultfd_copy path
  perf/core: fix parent pid/tid in task exit events
  ARM: dts: bcm283x: Disable dsi0 node
  net/cxgb4: Check the return from t4_query_params properly
  i2c: altera: use proper variable to hold errno
  nfsd: memory corruption in nfsd4_lock()
  iio:ad7797: Use correct attribute_group
  usb: gadget: udc: bdc: Remove unnecessary NULL checks in bdc_req_complete
  usb: dwc3: gadget: Do link recovery for SS and SSP
  binder: take read mode of mmap_sem in binder_alloc_free_page()
  include/uapi/linux/swab.h: fix userspace breakage, use __BITS_PER_LONG for swap
  mtd: cfi: fix deadloop in cfi_cmdset_0002.c do_write_buffer
  remoteproc: Fix wrong rvring index computation
  xfs: Fix deadlock between AGI and AGF with RENAME_WHITEOUT
  xfs: validate sb_logsunit is a multiple of the fs blocksize
  serial: sh-sci: Make sure status register SCxSR is read in correct sequence
  usb: f_fs: Clear OS Extended descriptor counts to zero in ffs_data_reset()
  UAS: fix deadlock in error handling and PM flushing work
  UAS: no use logging any details in case of ENODEV
  cdc-acm: introduce a cool down
  cdc-acm: close race betrween suspend() and acm_softint
  staging: vt6656: Power save stop wake_up_count wrap around.
  staging: vt6656: Fix pairwise key entry save.
  staging: vt6656: Fix drivers TBTT timing counter.
  staging: vt6656: Fix calling conditions of vnt_set_bss_mode
  staging: vt6656: Don't set RCR_MULTICAST or RCR_BROADCAST by default.
  vt: don't hardcode the mem allocation upper bound
  staging: comedi: Fix comedi_device refcnt leak in comedi_open
  staging: comedi: dt2815: fix writing hi byte of analog output
  powerpc/setup_64: Set cache-line-size based on cache-block-size
  ARM: imx: provide v7_cpu_resume() only on ARM_CPU_SUSPEND=y
  iwlwifi: pcie: actually release queue memory in TVQM
  ASoC: dapm: fixup dapm kcontrol widget
  audit: check the length of userspace generated audit records
  usb-storage: Add unusual_devs entry for JMicron JMS566
  tty: rocket, avoid OOB access
  tty: hvc: fix buffer overflow during hvc_alloc().
  KVM: VMX: Enable machine check support for 32bit targets
  KVM: Check validity of resolved slot when searching memslots
  tpm: ibmvtpm: retry on H_CLOSED in tpm_ibmvtpm_send()
  tpm/tpm_tis: Free IRQ if probing fails
  ALSA: usb-audio: Filter out unsupported sample rates on Focusrite devices
  ALSA: usb-audio: Fix usb audio refcnt leak when getting spdif
  ALSA: hda/realtek - Add new codec supported for ALC245
  ALSA: usx2y: Fix potential NULL dereference
  tools/vm: fix cross-compile build
  mm/ksm: fix NULL pointer dereference when KSM zero page is enabled
  mm/hugetlb: fix a addressing exception caused by huge_pte_offset
  vmalloc: fix remap_vmalloc_range() bounds checks
  overflow.h: Add arithmetic shift helper
  USB: hub: Fix handling of connect changes during sleep
  USB: core: Fix free-while-in-use bug in the USB S-Glibrary
  USB: early: Handle AMD's spec-compliant identifiers, too
  USB: Add USB_QUIRK_DELAY_CTRL_MSG and USB_QUIRK_DELAY_INIT for Corsair K70 RGB RAPIDFIRE
  USB: sisusbvga: Change port variable from signed to unsigned
  fs/namespace.c: fix mountpoint reference counter race
  iio: xilinx-xadc: Fix sequencer configuration for aux channels in simultaneous mode
  iio: xilinx-xadc: Fix clearing interrupt when enabling trigger
  iio: xilinx-xadc: Fix ADC-B powerdown
  iio: adc: stm32-adc: fix sleep in atomic context
  ALSA: hda: Remove ASUS ROG Zenith from the blacklist
  KEYS: Avoid false positive ENOMEM error on key read
  vrf: Check skb for XFRM_TRANSFORMED flag
  xfrm: Always set XFRM_TRANSFORMED in xfrm{4,6}_output_finish
  net: dsa: b53: Fix ARL register definitions
  team: fix hang in team_mode_get()
  tcp: cache line align MAX_TCP_HEADER
  net/x25: Fix x25_neigh refcnt leak when receiving frame
  net: netrom: Fix potential nr_neigh refcnt leak in nr_add_node
  net: bcmgenet: correct per TX/RX ring statistics
  macvlan: fix null dereference in macvlan_device_event()
  macsec: avoid to set wrong mtu
  ipv6: fix restrict IPV6_ADDRFORM operation
  cxgb4: fix large delays in PTP synchronization
  mm, slub: restore the original intention of prefetch_freepointer()
  PCI/ASPM: Allow re-enabling Clock PM
  perf/core: Disable page faults when getting phys address
  pwm: bcm2835: Dynamically allocate base
  pwm: renesas-tpu: Fix late Runtime PM enablement
  s390/cio: avoid duplicated 'ADD' uevents
  ipc/util.c: sysvipc_find_ipc() should increase position index
  selftests: kmod: fix handling test numbers above 9
  kernel/gcov/fs.c: gcov_seq_next() should increase position index
  ASoC: Intel: atom: Take the drv->lock mutex before calling sst_send_slot_map()
  scsi: iscsi: Report unbind session event when the target has been removed
  pwm: rcar: Fix late Runtime PM enablement
  ceph: don't skip updating wanted caps when cap is stale
  ceph: return ceph_mdsc_do_request() errors from __get_parent()
  scsi: lpfc: Fix kasan slab-out-of-bounds error in lpfc_unreg_login
  watchdog: reset last_hw_keepalive time at start
  vti4: removed duplicate log message.
  crypto: mxs-dcp - make symbols 'sha1_null_hash' and 'sha256_null_hash' static
  drm/msm: Use the correct dma_sync calls harder
  keys: Fix the use of the C++ keyword "private" in uapi/linux/keyctl.h
  net: ipv4: avoid unused variable warning for sysctl
  net: ipv4: emulate READ_ONCE() on ->hdrincl bit-field in raw_sendmsg()
  ext4: fix extent_status fragmentation for plain files
  FROMGIT: f2fs: fix missing check for f2fs_unlock_op
  ANDROID: Fix kernel build regressions from virtio-gpu-next patches
  ANDROID: Incremental fs: Add setattr call
  ANDROID: cuttlefish_defconfig: enable LTO and CFI
  ANDROID: x86: map CFI jump tables in pti_clone_entry_text
  ANDROID: crypto: aesni: fix function types for aesni_(enc|dec)
  ANDROID: x86: disable CFI for do_syscall_*
  ANDROID: BACKPORT: x86, module: Ignore __typeid__ relocations
  ANDROID: BACKPORT: x86, relocs: Ignore __typeid__ relocations
  ANDROID: BACKPORT: x86/extable: Do not mark exception callback as CFI
  FROMLIST: crypto, x86/sha: Eliminate casts on asm implementations
  UPSTREAM: crypto: x86 - Rename functions to avoid conflict with crypto/sha256.h
  BACKPORT: x86/vmlinux: Actually use _etext for the end of the text segment
  ANDROID: x86: disable STACK_VALIDATION with LTO_CLANG
  ANDROID: x86: add support for CONFIG_LTO_CLANG
  ANDROID: x86/vdso: disable LTO only for VDSO
  ANDROID: x86/cpu/vmware: use the full form of inl in VMWARE_PORT
  UPSTREAM: x86/build/lto: Fix truncated .bss with -fdata-sections
  ANDROID: kbuild: don't select LD_DEAD_CODE_DATA_ELIMINATION with LTO
  ANDROID: kbuild: export LTO and CFI flags
  ANDROID: cfi: remove unnecessary <asm/memory.h> include
  ANDROID: drm/virtio: rebase to latest virgl/drm-misc-next (take 2)
  UPSTREAM: sysrq: Use panic() to force a crash
  ANDROID: Incremental fs: Use simple compression in log buffer
  ANDROID: dm-bow: Fix not to skip trim at framented range
  ANDROID: Remove VLA from uid_sys_stats.c
  ANDROID: cuttlefish_defconfig: enable CONFIG_DEBUG_LIST
  Linux 4.14.177
  KEYS: Don't write out to userspace while holding key semaphore
  KEYS: Use individual pages in big_key for crypto buffers
  mtd: phram: fix a double free issue in error path
  mtd: lpddr: Fix a double free in probe()
  locktorture: Print ratio of acquisitions, not failures
  tty: evh_bytechan: Fix out of bounds accesses
  fbdev: potential information leak in do_fb_ioctl()
  net: dsa: bcm_sf2: Fix overflow checks
  iommu/amd: Fix the configuration of GCR3 table root pointer
  libnvdimm: Out of bounds read in __nd_ioctl()
  ext2: fix debug reference to ext2_xattr_cache
  ext2: fix empty body warnings when -Wextra is used
  iommu/vt-d: Fix mm reference leak
  NFS: Fix memory leaks in nfs_pageio_stop_mirroring()
  drm/amdkfd: kfree the wrong pointer
  x86: ACPI: fix CPU hotplug deadlock
  KVM: s390: vsie: Fix possible race when shadowing region 3 tables
  compiler.h: fix error in BUILD_BUG_ON() reporting
  percpu_counter: fix a data race at vm_committed_as
  include/linux/swapops.h: correct guards for non_swap_entry()
  ext4: do not commit super on read-only bdev
  powerpc/maple: Fix declaration made after definition
  s390/cpuinfo: fix wrong output when CPU0 is offline
  NFS: direct.c: Fix memory leak of dreq when nfs_get_lock_context fails
  NFSv4/pnfs: Return valid stateids in nfs_layout_find_inode_by_stateid()
  rtc: 88pm860x: fix possible race condition
  soc: imx: gpc: fix power up sequencing
  clk: tegra: Fix Tegra PMC clock out parents
  power: supply: bq27xxx_battery: Silence deferred-probe error
  clk: at91: usb: continue if clk_hw_round_rate() return zero
  of: unittest: kmemleak in of_unittest_platform_populate()
  rbd: call rbd_dev_unprobe() after unwatching and flushing notifies
  rbd: avoid a deadlock on header_rwsem when flushing notifies
  of: fix missing kobject init for !SYSFS && OF_DYNAMIC config
  soc: qcom: smem: Use le32_to_cpu for comparison
  wil6210: abort properly in cfg suspend
  wil6210: fix length check in __wmi_send
  wil6210: add block size checks during FW load
  wil6210: fix PCIe bus mastering in case of interface down
  rpmsg: glink: smem: Ensure ordering during tx
  rpmsg: glink: Fix missing mutex_init() in qcom_glink_alloc_channel()
  rtc: pm8xxx: Fix issue in RTC write path
  rpmsg: glink: use put_device() if device_register fail
  wil6210: rate limit wil_rx_refill error
  scsi: ufs: ufs-qcom: remove broken hci version quirk
  scsi: ufs: make sure all interrupts are processed
  wil6210: fix temperature debugfs
  wil6210: increase firmware ready timeout
  arch_topology: Fix section miss match warning due to free_raw_capacity()
  arm64: traps: Don't print stack or raw PC/LR values in backtraces
  arm64: perf: remove unsupported events for Cortex-A73
  Revert "gpio: set up initial state from .get_direction()"
  clk: Fix debugfs_create_*() usage
  drm: NULL pointer dereference [null-pointer-deref] (CWE 476) problem
  video: fbdev: sis: Remove unnecessary parentheses and commented code
  lib/raid6: use vdupq_n_u8 to avoid endianness warnings
  ALSA: hda: Don't release card at firmware loading error
  irqchip/mbigen: Free msi_desc on device teardown
  netfilter: nf_tables: report EOPNOTSUPP on unsupported flags/object type
  arm, bpf: Fix bugs with ALU64 {RSH, ARSH} BPF_K shift by 0
  ext4: use non-movable memory for superblock readahead
  scsi: sg: add sg_remove_request in sg_common_write
  objtool: Fix switch table detection in .text.unlikely
  mm/vmalloc.c: move 'area->pages' after if statement
  x86/resctrl: Fix invalid attempt at removing the default resource group
  x86/resctrl: Preserve CDP enable over CPU hotplug
  x86/intel_rdt: Enable L2 CDP in MSR IA32_L2_QOS_CFG
  x86/intel_rdt: Add two new resources for L2 Code and Data Prioritization (CDP)
  x86/intel_rdt: Enumerate L2 Code and Data Prioritization (CDP) feature
  x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE
  scsi: target: fix hang when multiple threads try to destroy the same iscsi session
  scsi: target: remove boilerplate code
  kvm: x86: Host feature SSBD doesn't imply guest feature SPEC_CTRL_SSBD
  dm flakey: check for null arg_name in parse_features()
  ext4: do not zeroout extents beyond i_disksize
  mac80211_hwsim: Use kstrndup() in place of kasprintf()
  btrfs: check commit root generation in should_ignore_root
  tracing: Fix the race between registering 'snapshot' event trigger and triggering 'snapshot' operation
  ALSA: usb-audio: Don't override ignore_ctl_error value from the map
  ASoC: Intel: mrfld: return error codes when an error occurs
  ASoC: Intel: mrfld: fix incorrect check on p->sink
  ext4: fix incorrect inodes per group in error message
  ext4: fix incorrect group count in ext4_fill_super error message
  pwm: pca9685: Fix PWM/GPIO inter-operation
  jbd2: improve comments about freeing data buffers whose page mapping is NULL
  scsi: ufs: Fix ufshcd_hold() caused scheduling while atomic
  net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes
  net: revert default NAPI poll timeout to 2 jiffies
  net: qrtr: send msgs from local of same id as broadcast
  net: ipv6: do not consider routes via gateways for anycast address check
  net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin
  hsr: check protocol version in hsr_newlink()
  amd-xgbe: Use __napi_schedule() in BH context
  mfd: dln2: Fix sanity checking for endpoints
  misc: echo: Remove unnecessary parentheses and simplify check for zero
  powerpc/fsl_booke: Avoid creating duplicate tlb1 entry
  ipmi: fix hung processes in __get_guid()
  ftrace/kprobe: Show the maxactive number on kprobe_events
  drm: Remove PageReserved manipulation from drm_pci_alloc
  drm/dp_mst: Fix clearing payload state on topology disable
  crypto: caam - update xts sector size for large input length
  dm zoned: remove duplicate nr_rnd_zones increase in dmz_init_zone()
  btrfs: use nofs allocations for running delayed items
  Btrfs: fix crash during unmount due to race with delayed inode workers
  powerpc: Make setjmp/longjmp signature standard
  powerpc: Add attributes for setjmp/longjmp
  scsi: mpt3sas: Fix kernel panic observed on soft HBA unplug
  powerpc/kprobes: Ignore traps that happened in real mode
  powerpc/xive: Use XIVE_BAD_IRQ instead of zero to catch non configured IPIs
  powerpc/hash64/devmap: Use H_PAGE_THP_HUGE when setting up huge devmap PTE entries
  powerpc/64/tm: Don't let userspace set regs->trap via sigreturn
  powerpc/powernv/idle: Restore AMR/UAMOR/AMOR after idle
  libata: Return correct status in sata_pmp_eh_recover_pm() when ATA_DFLAG_DETACH is set
  hfsplus: fix crash and filesystem corruption when deleting files
  cpufreq: powernv: Fix use-after-free
  kmod: make request_module() return an error when autoloading is disabled
  Input: i8042 - add Acer Aspire 5738z to nomux list
  s390/diag: fix display of diagnose call statistics
  perf tools: Support Python 3.8+ in Makefile
  ocfs2: no need try to truncate file beyond i_size
  fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once()
  ext4: fix a data race at inode->i_blocks
  NFS: Fix a page leak in nfs_destroy_unlinked_subrequests()
  rtc: omap: Use define directive for PIN_CONFIG_ACTIVE_HIGH
  arm64: armv8_deprecated: Fix undef_hook mask for thumb setend
  scsi: zfcp: fix missing erp_lock in port recovery trigger for point-to-point
  dm verity fec: fix memory leak in verity_fec_dtr
  mm: Use fixed constant in page_frag_alloc instead of size + 1
  tools: gpio: Fix out-of-tree build regression
  x86/speculation: Remove redundant arch_smt_update() invocation
  powerpc/pseries: Drop pointless static qualifier in vpa_debugfs_init()
  net: rtnl_configure_link: fix dev flags changes arg to __dev_notify_flags
  ALSA: hda: Initialize power_state field properly
  crypto: mxs-dcp - fix scatterlist linearization for hash
  btrfs: drop block from cache on error in relocation
  CIFS: Fix bug which the return value by asynchronous read is error
  KVM: VMX: fix crash cleanup when KVM wasn't used
  KVM: VMX: Always VMCLEAR in-use VMCSes during crash with kexec support
  KVM: x86: Allocate new rmap and large page tracking when moving memslot
  KVM: s390: vsie: Fix delivery of addressing exceptions
  KVM: s390: vsie: Fix region 1 ASCE sanity shadow address checks
  KVM: nVMX: Properly handle userspace interrupt window request
  x86/entry/32: Add missing ASM_CLAC to general_protection entry
  signal: Extend exec_id to 64bits
  ath9k: Handle txpower changes even when TPC is disabled
  MIPS: OCTEON: irq: Fix potential NULL pointer dereference
  irqchip/versatile-fpga: Apply clear-mask earlier
  KEYS: reaching the keys quotas correctly
  PCI: endpoint: Fix for concurrent memory allocation in OB address region
  PCI/ASPM: Clear the correct bits when enabling L1 substates
  nvme-fc: Revert "add module to ops template to allow module references"
  thermal: devfreq_cooling: inline all stubs for CONFIG_DEVFREQ_THERMAL=n
  acpi/x86: ignore unspecified bit positions in the ACPI global lock field
  media: ti-vpe: cal: fix disable_irqs to only the intended target
  ALSA: hda/realtek - Set principled PC Beep configuration for ALC256
  ALSA: doc: Document PC Beep Hidden Register on Realtek ALC256
  ALSA: pcm: oss: Fix regression by buffer overflow fix
  ALSA: ice1724: Fix invalid access for enumerated ctl items
  ALSA: hda: Fix potential access overflow in beep helper
  ALSA: hda: Add driver blacklist
  ALSA: usb-audio: Add mixer workaround for TRX40 and co
  usb: gadget: composite: Inform controller driver of self-powered
  usb: gadget: f_fs: Fix use after free issue as part of queue failure
  ASoC: topology: use name_prefix for new kcontrol
  ASoC: dpcm: allow start or stop during pause for backend
  ASoC: dapm: connect virtual mux with default value
  ASoC: fix regwmask
  slub: improve bit diffusion for freelist ptr obfuscation
  misc: rtsx: set correct pcr_ops for rts522A
  uapi: rename ext2_swab() to swab() and share globally in swab.h
  btrfs: track reloc roots based on their commit root bytenr
  btrfs: remove a BUG_ON() from merge_reloc_roots()
  block, bfq: fix use-after-free in bfq_idle_slice_timer_body
  locking/lockdep: Avoid recursion in lockdep_count_{for,back}ward_deps()
  irqchip/gic-v4: Provide irq_retrigger to avoid circular locking dependency
  usb: dwc3: core: add support for disabling SS instances in park mode
  block: Fix use-after-free issue accessing struct io_cq
  genirq/irqdomain: Check pointer in irq_domain_alloc_irqs_hierarchy()
  efi/x86: Ignore the memory attributes table on i386
  x86/boot: Use unsigned comparison for addresses
  gfs2: Don't demote a glock until its revokes are written
  libata: Remove extra scsi_host_put() in ata_scsi_add_hosts()
  PCI/switchtec: Fix init_completion race condition with poll_wait()
  selftests/x86/ptrace_syscall_32: Fix no-vDSO segfault
  sched: Avoid scale real weight down to zero
  irqchip/versatile-fpga: Handle chained IRQs properly
  block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices
  x86: Don't let pgprot_modify() change the page encryption bit
  null_blk: fix spurious IO errors after failed past-wp access
  null_blk: Handle null_add_dev() failures properly
  null_blk: Fix the null_add_dev() error path
  i2c: st: fix missing struct parameter description
  qlcnic: Fix bad kzalloc null test
  cxgb4/ptp: pass the sign of offset delta in FW CMD
  hinic: fix wrong para of wait_for_completion_timeout
  hinic: fix a bug of waitting for IO stopped
  net: vxge: fix wrong __VA_ARGS__ usage
  bus: sunxi-rsb: Return correct data when mixing 16-bit and 8-bit reads
  ANDROID: fix wakeup reason findings
  UPSTREAM: gpu/trace: add a gpu total memory usage tracepoint
  CHROMIUM: drm/virtio: rebase zero-copy patches to virgl/drm-misc-next
  CHROMIUM: virtio-gpu: add VIRTIO_GPU_F_RESOURCE_UUID feature
  CHROMIUM: drm/virtgpu: add legacy VIRTIO_GPU_* values for non-upstream variants
  CHROMIUM: drm/virtgpu: fix various warnings
  CHROMIUM: drm/virtgpu: implement metadata allocation ioctl
  CHROMIUM: drm/virtgpu: introduce request IDRs
  CHROMIUM: drm/virtgpu: implement DRM_VIRTGPU_RESOURCE_CREATE_V2
  CHROMIUM: drm/virtgpu: add stub ioctl implementation
  CHROMIUM: drm/virtgpu: check for revelant capabilites
  CHROMIUM: drm/virtgpu: add memory type to virtio_gpu_object_params
  CHROMIUM: drm/virtgpu: make memory and resource creation opaque
  CHROMIUM: virtio-gpu api: VIRTIO_GPU_F_MEMORY
  CHROMIUM: virtwl: store plane info per virtio_gpu_object
  CHROMIUM: drm/virtgpu: expose new ioctls to userspace
  BACKPORT: drm/virtio: move virtio_gpu_object_{attach, detach} calls.
  ANDROID: drm: ttm: Add ttm_tt_create2 driver hook
  UPSTREAM: virtio-gpu api: comment feature flags
  UPSTREAM: drm/virtio: module_param_named() requires linux/moduleparam.h
  BACKPORT: drm/virtio: fix resource id creation race
  BACKPORT: drm/virtio: make resource id workaround runtime switchable.
  BACKPORT: drm/virtio: do NOT reuse resource ids
  BACKPORT: drm/virtio: Drop deprecated load/unload initialization
  f2fs: fix quota_sync failure due to f2fs_lock_op
  f2fs: support read iostat
  f2fs: Fix the accounting of dcc->undiscard_blks
  f2fs: fix to handle error path of f2fs_ra_meta_pages()
  f2fs: report the discard cmd errors properly
  f2fs: fix long latency due to discard during umount
  f2fs: add tracepoint for f2fs iostat
  f2fs: introduce sysfs/data_io_flag to attach REQ_META/FUA
  UPSTREAM: kheaders: include only headers into kheaders_data.tar.xz
  UPSTREAM: kheaders: remove meaningless -R option of 'ls'
  ANDROID: Incremental fs: Fix create_file performance
  ANDROID: Incremental fs: Fix compound page usercopy crash
  ANDROID: Incremental fs: Clean up incfs_test build process
  ANDROID: Incremental fs: make remount log buffer change atomic
  ANDROID: Incremental fs: Optimize get_filled_block
  ANDROID: Incremental fs: Fix mislabeled __user ptrs
  ANDROID: Incremental fs: Use 64-bit int for file_size when writing hash blocks
  Revert "ANDROID: Incremental fs: Fix initialization, use of bitfields"
  Linux 4.14.176
  drm/msm: Use the correct dma_sync calls in msm_gem
  rpmsg: glink: smem: Support rx peak for size less than 4 bytes
  drm_dp_mst_topology: fix broken drm_dp_sideband_parse_remote_dpcd_read()
  usb: dwc3: don't set gadget->is_otg flag
  rpmsg: glink: Remove chunk size word align warning
  arm64: Fix size of __early_cpu_boot_status
  drm/msm: stop abusing dma_map/unmap for cache
  clk: qcom: rcg: Return failure for RCG update
  acpi/nfit: Fix bus command validation
  fbcon: fix null-ptr-deref in fbcon_switch
  RDMA/cm: Update num_paths in cma_resolve_iboe_route error flow
  Bluetooth: RFCOMM: fix ODEBUG bug in rfcomm_dev_ioctl
  ceph: canonicalize server path in place
  ceph: remove the extra slashes in the server path
  IB/hfi1: Fix memory leaks in sysfs registration and unregistration
  IB/hfi1: Call kobject_put() when kobject_init_and_add() fails
  ASoC: jz4740-i2s: Fix divider written at incorrect offset in register
  hwrng: imx-rngc - fix an error path
  tools/accounting/getdelays.c: fix netlink attribute length
  random: always use batched entropy for get_random_u{32,64}
  mlxsw: spectrum_flower: Do not stop at FLOW_ACTION_VLAN_MANGLE
  slcan: Don't transmit uninitialized stack data in padding
  net: stmmac: dwmac1000: fix out-of-bounds mac address reg setting
  net: phy: micrel: kszphy_resume(): add delay after genphy_resume() before accessing PHY registers
  net: dsa: bcm_sf2: Ensure correct sub-node is parsed
  ipv6: don't auto-add link-local address to lag ports
  mm: mempolicy: require at least one nodeid for MPOL_PREFERRED
  padata: always acquire cpu_hotplug_lock before pinst->lock
  coresight: do not use the BIT() macro in the UAPI header
  misc: pci_endpoint_test: Fix to support > 10 pci-endpoint-test devices
  blk-mq: Allow blocking queue tag iter callbacks
  blk-mq: sync the update nr_hw_queues with blk_mq_queue_tag_busy_iter
  drm/etnaviv: replace MMU flush marker with flush sequence
  tools/power turbostat: Fix gcc build warnings
  initramfs: restore default compression behavior
  drm/bochs: downgrade pci_request_region failure from error to warning
  sctp: fix possibly using a bad saddr with a given dst
  sctp: fix refcount bug in sctp_wfree
  net, ip_tunnel: fix interface lookup with no key
  ipv4: fix a RCU-list lock in fib_triestat_seq_show
  ANDROID: power: wakeup_reason: wake reason enhancements
  ubifs: wire up FS_IOC_GET_ENCRYPTION_NONCE
  f2fs: wire up FS_IOC_GET_ENCRYPTION_NONCE
  ext4: wire up FS_IOC_GET_ENCRYPTION_NONCE
  fscrypt: add FS_IOC_GET_ENCRYPTION_NONCE ioctl
  FROMLIST: power_supply: Add additional health properties to the header
  UPSTREAM: power: supply: core: Update sysfs-class-power ABI document
  BACKPORT: FROMGIT: kbuild: mkcompile_h: Include $LD version in /proc/version
  ANDROID: fscrypt: fall back to filesystem-layer crypto when needed
  ANDROID: block: require drivers to declare supported crypto key type(s)
  ANDROID: block: make blk_crypto_start_using_mode() properly check for support
  f2fs: keep inline_data when compression conversion
  f2fs: fix to disable compression on directory
  f2fs: add missing CONFIG_F2FS_FS_COMPRESSION
  f2fs: switch discard_policy.timeout to bool type
  f2fs: fix to verify tpage before releasing in f2fs_free_dic()
  f2fs: show compression in statx
  f2fs: clean up dic->tpages assignment
  f2fs: compress: support zstd compress algorithm
  f2fs: compress: add .{init,destroy}_decompress_ctx callback
  f2fs: compress: fix to call missing destroy_compress_ctx()
  f2fs: change default compression algorithm
  f2fs: clean up {cic,dic}.ref handling
  f2fs: fix to use f2fs_readpage_limit() in f2fs_read_multi_pages()
  f2fs: xattr.h: Make stub helpers inline
  f2fs: fix to avoid double unlock
  f2fs: fix potential .flags overflow on 32bit architecture
  f2fs: fix NULL pointer dereference in f2fs_verity_work()
  f2fs: fix to clear PG_error if fsverity failed
  f2fs: don't call fscrypt_get_encryption_info() explicitly in f2fs_tmpfile()
  f2fs: don't trigger data flush in foreground operation
  f2fs: fix NULL pointer dereference in f2fs_write_begin()
  f2fs: clean up f2fs_may_encrypt()
  f2fs: fix to avoid potential deadlock
  f2fs: don't change inode status under page lock
  f2fs: fix potential deadlock on compressed quota file
  f2fs: delete DIO read lock
  f2fs: don't mark compressed inode dirty during f2fs_iget()
  f2fs: fix to account compressed blocks in f2fs_compressed_blocks()
  f2fs: xattr.h: Replace zero-length array with flexible-array member
  f2fs: fix to update f2fs_super_block fields under sb_lock
  f2fs: Add a new CP flag to help fsck fix resize SPO issues
  f2fs: Fix mount failure due to SPO after a successful online resize FS
  f2fs: use kmem_cache pool during inline xattr lookups
  f2fs: skip migration only when BG_GC is called
  f2fs: fix to show tracepoint correctly
  f2fs: avoid __GFP_NOFAIL in f2fs_bio_alloc
  f2fs: introduce F2FS_IOC_GET_COMPRESS_BLOCKS
  f2fs: fix to avoid triggering IO in write path
  f2fs: add prefix for f2fs slab cache name
  f2fs: introduce DEFAULT_IO_TIMEOUT
  f2fs: skip GC when section is full
  f2fs: add migration count iff migration happens
  f2fs: clean up bggc mount option
  f2fs: clean up lfs/adaptive mount option
  f2fs: fix to show norecovery mount option
  f2fs: clean up parameter of macro XATTR_SIZE()
  f2fs: clean up codes with {f2fs_,}data_blkaddr()
  f2fs: show mounted time
  f2fs: Use scnprintf() for avoiding potential buffer overflow
  f2fs: allow to clear F2FS_COMPR_FL flag
  f2fs: fix to check dirty pages during compressed inode conversion
  f2fs: fix to account compressed inode correctly
  f2fs: fix wrong check on F2FS_IOC_FSSETXATTR
  f2fs: fix to avoid use-after-free in f2fs_write_multi_pages()
  f2fs: fix to avoid using uninitialized variable
  f2fs: fix inconsistent comments
  f2fs: remove i_sem lock coverage in f2fs_setxattr()
  f2fs: cover last_disk_size update with spinlock
  f2fs: fix to check i_compr_blocks correctly
  FROMLIST: kmod: make request_module() return an error when autoloading is disabled
  UPSTREAM: loop: Only freeze block queue when needed.
  UPSTREAM: loop: Only change blocksize when needed.
  ANDROID: Incremental fs: Fix remount
  ANDROID: Incremental fs: Protect get_fill_block, and add a field
  ANDROID: Incremental fs: Fix crash polling 0 size read_log
  ANDROID: Incremental fs: get_filled_blocks: better index_out
  ANDROID: Fix wq fp check for CFI builds
  ANDROID: Incremental fs: Fix four resource bugs
  ANDROID: kbuild: ensure __cfi_check is correctly aligned
  ANDROID: kbuild: fix module linker script flags for LTO
  Linux 4.14.175
  arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode
  arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id
  ARM: bcm2835-rpi-zero-w: Add missing pinctrl name
  ARM: dts: oxnas: Fix clear-mask property
  perf map: Fix off by one in strncpy() size argument
  arm64: alternative: fix build with clang integrated assembler
  net: ks8851-ml: Fix IO operations, again
  gpiolib: acpi: Add quirk to ignore EC wakeups on HP x2 10 CHT + AXP288 model
  bpf: Explicitly memset some bpf info structures declared on the stack
  bpf: Explicitly memset the bpf_attr structure
  platform/x86: pmc_atom: Add Lex 2I385SW to critclk_systems DMI table
  vt: vt_ioctl: fix use-after-free in vt_in_use()
  vt: vt_ioctl: fix VT_DISALLOCATE freeing in-use virtual console
  vt: vt_ioctl: remove unnecessary console allocation checks
  vt: switch vt_dont_switch to bool
  vt: ioctl, switch VT_IS_IN_USE and VT_BUSY to inlines
  vt: selection, introduce vc_is_sel
  mac80211: fix authentication with iwlwifi/mvm
  mac80211: Check port authorization in the ieee80211_tx_dequeue() case
  media: xirlink_cit: add missing descriptor sanity checks
  media: stv06xx: add missing descriptor sanity checks
  media: dib0700: fix rc endpoint lookup
  media: ov519: add missing endpoint sanity checks
  libfs: fix infoleak in simple_attr_read()
  staging: wlan-ng: fix use-after-free Read in hfa384x_usbin_callback
  staging: wlan-ng: fix ODEBUG bug in prism2sta_disconnect_usb
  staging: rtl8188eu: Add ASUS USB-N10 Nano B1 to device table
  media: usbtv: fix control-message timeouts
  media: flexcop-usb: fix endpoint sanity check
  usb: musb: fix crash with highmen PIO and usbmon
  USB: serial: io_edgeport: fix slab-out-of-bounds read in edge_interrupt_callback
  USB: cdc-acm: restore capability check order
  USB: serial: option: add Wistron Neweb D19Q1
  USB: serial: option: add BroadMobi BM806U
  USB: serial: option: add support for ASKEY WWHC050
  afs: Fix some tracing details
  Input: raydium_i2c_ts - fix error codes in raydium_i2c_boot_trigger()
  Input: raydium_i2c_ts - use true and false for boolean values
  vti6: Fix memory leak of skb if input policy check fails
  netfilter: nft_fwd_netdev: validate family and chain type
  xfrm: policy: Fix doulbe free in xfrm_policy_timer
  xfrm: add the missing verify_sec_ctx_len check in xfrm_add_acquire
  xfrm: fix uctx len check in verify_sec_ctx_len
  RDMA/mlx5: Block delay drop to unprivileged users
  vti[6]: fix packet tx through bpf_redirect() in XinY cases
  xfrm: handle NETDEV_UNREGISTER for xfrm device
  genirq: Fix reference leaks on irq affinity notifiers
  RDMA/core: Ensure security pkey modify is not lost
  gpiolib: acpi: Add quirk to ignore EC wakeups on HP x2 10 BYT + AXP288 model
  gpiolib: acpi: Rework honor_wakeup option into an ignore_wake option
  gpiolib: acpi: Correct comment for HP x2 10 honor_wakeup quirk
  mac80211: mark station unauthorized before key removal
  scsi: sd: Fix optimal I/O size for devices that change reported values
  scripts/dtc: Remove redundant YYLOC global declaration
  tools: Let O= makes handle a relative path with -C option
  perf probe: Do not depend on dwfl_module_addrsym()
  ARM: dts: omap5: Add bus_dma_limit for L3 bus
  ARM: dts: dra7: Add bus_dma_limit for L3 bus
  Input: avoid BIT() macro usage in the serio.h UAPI header
  Input: synaptics - enable RMI on HP Envy 13-ad105ng
  i2c: hix5hd2: add missed clk_disable_unprepare in remove
  ftrace/x86: Anotate text_mutex split between ftrace_arch_code_modify_post_process() and ftrace_arch_code_modify_prepare()
  arm64: compat: map SPSR_ELx<->PSR for signals
  arm64: ptrace: map SPSR_ELx<->PSR for compat tasks
  sxgbe: Fix off by one in samsung driver strncpy size arg
  dpaa_eth: Remove unnecessary boolean expression in dpaa_get_headroom
  mac80211: Do not send mesh HWMP PREQ if HWMP is disabled
  scsi: ipr: Fix softlockup when rescanning devices in petitboot
  fsl/fman: detect FMan erratum A050385
  arm64: dts: ls1043a: FMan erratum A050385
  dt-bindings: net: FMan erratum A050385
  cgroup1: don't call release_agent when it is ""
  drivers/of/of_mdio.c:fix of_mdiobus_register()
  cpupower: avoid multiple definition with gcc -fno-common
  cgroup-v1: cgroup_pidlist_next should update position index
  net: ipv4: don't let PMTU updates increase route MTU
  hsr: set .netnsok flag
  hsr: add restart routine into hsr_get_node_list()
  hsr: use rcu_read_lock() in hsr_get_node_{list/status}()
  vxlan: check return value of gro_cells_init()
  net: dsa: mt7530: Change the LINK bit to reflect the link status
  bnxt_en: fix memory leaks in bnxt_dcbnl_ieee_getets()
  slcan: not call free_netdev before rtnl_unlock in slcan_open
  NFC: fdp: Fix a signedness bug in fdp_nci_send_patch()
  net: stmmac: dwmac-rk: fix error path in rk_gmac_probe
  net_sched: keep alloc_hash updated after hash allocation
  net_sched: cls_route: remove the right filter from hashtable
  net: qmi_wwan: add support for ASKEY WWHC050
  net/packet: tpacket_rcv: avoid a producer race condition
  net: mvneta: Fix the case where the last poll did not process all rx
  net: dsa: Fix duplicate frames flooded by learning
  macsec: restrict to ethernet devices
  hsr: fix general protection fault in hsr_addr_is_self()
  Revert "drm/dp_mst: Skip validating ports during destruction, just ref"
  staging: greybus: loopback_test: fix potential path truncations
  staging: greybus: loopback_test: fix potential path truncation
  drm/bridge: dw-hdmi: fix AVI frame colorimetry
  arm64: smp: fix crash_smp_send_stop() behaviour
  arm64: smp: fix smp_send_stop() behaviour
  ALSA: hda/realtek: Fix pop noise on ALC225
  Revert "ipv6: Fix handling of LLA with VRF and sockets bound to VRF"
  Revert "vrf: mark skb for multicast or link-local as enslaved to VRF"
  futex: Unbreak futex hashing
  futex: Fix inode life-time issue
  kbuild: Disable -Wpointer-to-enum-cast
  iio: adc: at91-sama5d2_adc: fix differential channels in triggered mode
  iio: adc: at91-sama5d2_adc: fix channel configuration for differential channels
  USB: cdc-acm: fix rounding error in TIOCSSERIAL
  USB: cdc-acm: fix close_delay and closing_wait units in TIOCSSERIAL
  x86/mm: split vmalloc_sync_all()
  page-flags: fix a crash at SetPageError(THP_SWAP)
  mm, slub: prevent kmalloc_node crashes and memory leaks
  mm: slub: be more careful about the double cmpxchg of freelist
  memcg: fix NULL pointer dereference in __mem_cgroup_usage_unregister_event
  xhci: Do not open code __print_symbolic() in xhci trace events
  rtc: max8907: add missing select REGMAP_IRQ
  intel_th: pci: Add Elkhart Lake CPU support
  intel_th: Fix user-visible error codes
  staging/speakup: fix get_word non-space look-ahead
  staging: rtl8188eu: Add device id for MERCUSYS MW150US v2
  mmc: sdhci-of-at91: fix cd-gpios for SAMA5D2
  iio: magnetometer: ak8974: Fix negative raw values in sysfs
  iio: trigger: stm32-timer: disable master mode when stopping
  ALSA: pcm: oss: Remove WARNING from snd_pcm_plug_alloc() checks
  ALSA: pcm: oss: Avoid plugin buffer overflow
  ALSA: seq: oss: Fix running status after receiving sysex
  ALSA: seq: virmidi: Fix running status after receiving sysex
  ALSA: line6: Fix endless MIDI read loop
  usb: xhci: apply XHCI_SUSPEND_DELAY to AMD XHCI controller 1022:145c
  USB: serial: pl2303: add device-id for HP LD381
  usb: host: xhci-plat: add a shutdown
  USB: serial: option: add ME910G1 ECM composition 0x110b
  usb: quirks: add NO_LPM quirk for RTL8153 based ethernet adapters
  USB: Disable LPM on WD19's Realtek Hub
  parse-maintainers: Mark as executable
  block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group()
  xenbus: req->err should be updated before req->state
  xenbus: req->body should be updated before req->state
  dm bio record: save/restore bi_end_io and bi_integrity
  altera-stapl: altera_get_note: prevent write beyond end of 'key'
  drivers/perf: arm_pmu_acpi: Fix incorrect checking of gicc pointer
  drm/exynos: dsi: fix workaround for the legacy clock name
  drm/exynos: dsi: propagate error value and silence meaningless warning
  spi/zynqmp: remove entry that causes a cs glitch
  spi: pxa2xx: Add CS control clock quirk
  ARM: dts: dra7: Add "dma-ranges" property to PCIe RC DT nodes
  powerpc: Include .BTF section
  spi: qup: call spi_qup_pm_resume_runtime before suspending
  UPSTREAM: ubifs: wire up FS_IOC_GET_ENCRYPTION_NONCE
  UPSTREAM: f2fs: wire up FS_IOC_GET_ENCRYPTION_NONCE
  UPSTREAM: ext4: wire up FS_IOC_GET_ENCRYPTION_NONCE
  UPSTREAM: fscrypt: add FS_IOC_GET_ENCRYPTION_NONCE ioctl
  UPSTREAM: usb: raw_gadget: fix compilation warnings in uapi headers
  BACKPORT: usb: gadget: add raw-gadget interface
  UPSTREAM: usb: gadget: move choice ... endchoice to legacy/Kconfig
  ANDROID: clang: update to 10.0.5
  FROMLIST: arm64: define __alloc_zeroed_user_highpage
  ANDROID: Incremental fs: Add INCFS_IOC_GET_FILLED_BLOCKS
  ANDROID: Incremental fs: Fix two typos
  f2fs: fix to avoid potential deadlock
  f2fs: add missing function name in kernel message
  f2fs: recycle unused compress_data.chksum feild
  f2fs: fix to avoid NULL pointer dereference
  f2fs: fix leaking uninitialized memory in compressed clusters
  f2fs: fix the panic in do_checkpoint()
  f2fs: fix to wait all node page writeback
  mm/swapfile.c: move inode_lock out of claim_swapfile
  UPSTREAM: ipv6: ndisc: add support for 'PREF64' dns64 prefix identifier
  UPSTREAM: ipv6: ndisc: add support for 'PREF64' dns64 prefix identifier
  ANDROID: dm-bow: Fix free_show value is incorrect
  UPSTREAM: coresight: Potential uninitialized variable in probe()
  ANDROID: kbuild: do not merge .section..* into .section in modules
  ANDROID: scsi: ufs: add ->map_sg_crypto() variant op
  UPSTREAM: bpf: Explicitly memset some bpf info structures declared on the stack
  UPSTREAM: bpf: Explicitly memset the bpf_attr structure
  Linux 4.14.174
  ipv4: ensure rcu_read_lock() in cipso_v4_error()
  mm: slub: add missing TID bump in kmem_cache_alloc_bulk()
  ARM: 8958/1: rename missed uaccess .fixup section
  ARM: 8957/1: VDSO: Match ARMv8 timer in cntvct_functional()
  jbd2: fix data races at struct journal_head
  net: rmnet: fix NULL pointer dereference in rmnet_newlink()
  hinic: fix a bug of setting hw_ioctxt
  slip: not call free_netdev before rtnl_unlock in slip_open
  signal: avoid double atomic counter increments for user accounting
  mac80211: rx: avoid RCU list traversal under mutex
  net: ks8851-ml: Fix IRQ handling and locking
  net: usb: qmi_wwan: restore mtu min/max values after raw_ip switch
  scsi: libfc: free response frame from GPN_ID
  cfg80211: check reg_rule for NULL in handle_channel_custom()
  HID: i2c-hid: add Trekstor Surfbook E11B to descriptor override
  HID: apple: Add support for recent firmware on Magic Keyboards
  ACPI: watchdog: Allow disabling WDAT at boot
  perf/amd/uncore: Replace manual sampling check with CAP_NO_INTERRUPT flag
  batman-adv: Don't schedule OGM for disabled interface
  batman-adv: Avoid free/alloc race when handling OGM buffer
  batman-adv: Avoid free/alloc race when handling OGM2 buffer
  batman-adv: Fix duplicated OGMs on NETDEV_UP
  batman-adv: Fix debugfs path for renamed softif
  batman-adv: Fix debugfs path for renamed hardif
  batman-adv: prevent TT request storms by not sending inconsistent TT TLVLs
  batman-adv: Fix TT sync flags for intermediate TT responses
  batman-adv: Avoid race in TT TVLV allocator helper
  batman-adv: update data pointers after skb_cow()
  batman-adv: Fix internal interface indices types
  batman-adv: Fix lock for ogm cnt access in batadv_iv_ogm_calc_tq
  batman-adv: Fix check of retrieved orig_gw in batadv_v_gw_is_eligible
  batman-adv: Always initialize fragment header priority
  batman-adv: Avoid spurious warnings from bat_v neigh_cmp implementation
  efi: Add a sanity check to efivar_store_raw()
  net/smc: check for valid ib_client_data
  ipv6: restrict IPV6_ADDRFORM operation
  i2c: acpi: put device when verifying client fails
  iommu/vt-d: Ignore devices with out-of-spec domain number
  iommu/vt-d: Fix the wrong printing in RHSA parsing
  netfilter: nft_payload: add missing attribute validation for payload csum flags
  netfilter: cthelper: add missing attribute validation for cthelper
  nl80211: add missing attribute validation for channel switch
  nl80211: add missing attribute validation for beacon report scanning
  nl80211: add missing attribute validation for critical protocol indication
  pinctrl: core: Remove extra kref_get which blocks hogs being freed
  pinctrl: meson-gxl: fix GPIOX sdio pins
  iommu/vt-d: Fix a bug in intel_iommu_iova_to_phys() for huge page
  iommu/vt-d: dmar: replace WARN_TAINT with pr_warn + add_taint
  iommu/dma: Fix MSI reservation allocation
  x86/mce: Fix logic and comments around MSR_PPIN_CTL
  efi: Fix a race and a buffer overflow while reading efivars via sysfs
  ARC: define __ALIGN_STR and __ALIGN symbols for ARC
  KVM: x86: clear stale x86_emulate_ctxt->intercept value
  gfs2_atomic_open(): fix O_EXCL|O_CREAT handling on cold dcache
  cifs_atomic_open(): fix double-put on late allocation failure
  ktest: Add timeout for ssh sync testing
  drm/amd/display: remove duplicated assignment to grph_obj_type
  workqueue: don't use wq_select_unbound_cpu() for bound works
  iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint
  virtio-blk: fix hw_queue stopped on arbitrary error
  iwlwifi: mvm: Do not require PHY_SKU NVM section for 3168 devices
  cgroup: Iterate tasks that did not finish do_exit()
  cgroup: cgroup_procs_next should increase position index
  ipvlan: don't deref eth hdr before checking it's set
  ipvlan: egress mcast packets are not exceptional
  ipvlan: do not add hardware address of master to its unicast filter list
  inet_diag: return classid for all socket types
  macvlan: add cond_resched() during multicast processing
  net: fec: validate the new settings in fec_enet_set_coalesce()
  slip: make slhc_compress() more robust against malicious packets
  bonding/alb: make sure arp header is pulled before accessing it
  net: phy: fix MDIO bus PM PHY resuming
  nfc: add missing attribute validation for vendor subcommand
  nfc: add missing attribute validation for SE API
  team: add missing attribute validation for array index
  team: add missing attribute validation for port ifindex
  net: fq: add missing attribute validation for orphan mask
  macsec: add missing attribute validation for port
  can: add missing attribute validation for termination
  nl802154: add missing attribute validation for dev_type
  nl802154: add missing attribute validation
  fib: add missing attribute validation for tun_id
  net: memcg: fix lockdep splat in inet_csk_accept()
  net: memcg: late association of sock to memcg
  cgroup: memcg: net: do not associate sock with unrelated cgroup
  bnxt_en: reinitialize IRQs when MTU is modified
  sfc: detach from cb_page in efx_copy_channel()
  r8152: check disconnect status after long sleep
  net/packet: tpacket_rcv: do not increment ring index on drop
  net: nfc: fix bounds checking bugs on "pipe"
  net: macsec: update SCI upon MAC address change.
  netlink: Use netlink header as base to calculate bad attribute offset
  ipvlan: do not use cond_resched_rcu() in ipvlan_process_multicast()
  ipvlan: add cond_resched_rcu() while processing muticast backlog
  ipv6/addrconf: call ipv6_mc_up() for non-Ethernet interface
  gre: fix uninit-value in __iptunnel_pull_header
  cgroup, netclassid: periodically release file_lock on classid updating
  net: phy: Avoid multiple suspends
  phy: Revert toggling reset changes.
  ANDROID: Incremental fs: Add INCFS_IOC_PERMIT_FILL
  ANDROID: Incremental fs: Remove signature checks from kernel
  ANDROID: Incremental fs: Pad hash blocks
  ANDROID: Incremental fs: Make fill block an ioctl
  ANDROID: Incremental fs: Remove all access_ok checks
  UPSTREAM: cgroup: Iterate tasks that did not finish do_exit()
  UPSTREAM: arm64: memory: Add missing brackets to untagged_addr() macro
  UPSTREAM: mm: Avoid creating virtual address aliases in brk()/mmap()/mremap()
  ANDROID: Add TPM support and the vTPM proxy to Cuttlefish.
  ANDROID: serdev: restrict claim of platform devices
  UPSTREAM: fscrypt: don't evict dirty inodes after removing key
  fscrypt: don't evict dirty inodes after removing key
  Linux 4.14.173
  ASoC: topology: Fix memleak in soc_tplg_manifest_load()
  xhci: handle port status events for removed USB3 hcd
  dm integrity: fix a deadlock due to offloading to an incorrect workqueue
  powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems
  dmaengine: coh901318: Fix a double lock bug in dma_tc_handle()
  hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT()
  ARM: imx: build v7_cpu_resume() unconditionally
  IB/hfi1, qib: Ensure RCU is locked when accessing list
  RMDA/cm: Fix missing ib_cm_destroy_id() in ib_cm_insert_listen()
  RDMA/iwcm: Fix iwcm work deallocation
  ASoC: dapm: Correct DAPM handling of active widgets during shutdown
  ASoC: pcm512x: Fix unbalanced regulator enable call in probe error path
  ASoC: pcm: Fix possible buffer overflow in dpcm state sysfs output
  ASoC: intel: skl: Fix possible buffer overflow in debug outputs
  ASoC: intel: skl: Fix pin debug prints
  ASoC: topology: Fix memleak in soc_tplg_link_elems_load()
  ARM: dts: ls1021a: Restore MDIO compatible to gianfar
  dm cache: fix a crash due to incorrect work item cancelling
  dmaengine: tegra-apb: Prevent race conditions of tasklet vs free list
  dmaengine: tegra-apb: Fix use-after-free
  x86/pkeys: Manually set X86_FEATURE_OSPKE to preserve existing changes
  vt: selection, push sel_lock up
  vt: selection, push console lock down
  vt: selection, close sel_buffer race
  serial: 8250_exar: add support for ACCES cards
  tty:serial:mvebu-uart:fix a wrong return
  arm: dts: dra76x: Fix mmc3 max-frequency
  fat: fix uninit-memory access for partial initialized inode
  mm, numa: fix bad pmd by atomically check for pmd_trans_huge when marking page tables prot_numa
  vgacon: Fix a UAF in vgacon_invert_region
  usb: core: port: do error out if usb_autopm_get_interface() fails
  usb: core: hub: do error out if usb_autopm_get_interface() fails
  usb: core: hub: fix unhandled return by employing a void function
  usb: quirks: add NO_LPM quirk for Logitech Screen Share
  usb: storage: Add quirk for Samsung Fit flash
  cifs: don't leak -EAGAIN for stat() during reconnect
  net: thunderx: workaround BGX TX Underflow issue
  x86/xen: Distribute switch variables for initialization
  nvme: Fix uninitialized-variable warning
  x86/boot/compressed: Don't declare __force_order in kaslr_64.c
  s390/cio: cio_ignore_proc_seq_next should increase position index
  watchdog: da9062: do not ping the hw during stop()
  net: ks8851-ml: Fix 16-bit IO operation
  net: ks8851-ml: Fix 16-bit data access
  net: ks8851-ml: Remove 8-bit bus accessors
  drm/msm/dsi: save pll state before dsi host is powered off
  drm: msm: Fix return type of dsi_mgr_connector_mode_valid for kCFI
  drm/msm/mdp5: rate limit pp done timeout warnings
  usb: gadget: serial: fix Tx stall after buffer overflow
  usb: gadget: ffs: ffs_aio_cancel(): Save/restore IRQ flags
  usb: gadget: composite: Support more than 500mA MaxPower
  selftests: fix too long argument
  serial: ar933x_uart: set UART_CS_{RX,TX}_READY_ORIDE
  kprobes: Fix optimize_kprobe()/unoptimize_kprobe() cancellation logic
  RDMA/core: Fix use of logical OR in get_new_pps
  RDMA/core: Fix pkey and port assignment in get_new_pps
  net: dsa: bcm_sf2: Forcibly configure IMP port for 1Gb/sec
  EDAC/amd64: Set grain per DIMM
  x86/mce: Handle varying MCA bank counts
  vhost: Check docket sk_family instead of call getname
  audit: always check the netlink payload length in audit_receive_msg()
  Revert "char/random: silence a lockdep splat with printk()"
  mm, thp: fix defrag setting if newline is not used
  mm/huge_memory.c: use head to check huge zero page
  perf hists browser: Restore ESC as "Zoom out" of DSO/thread/etc
  kprobes: Set unoptimized flag after unoptimizing code
  drivers: net: xgene: Fix the order of the arguments of 'alloc_etherdev_mqs()'
  tuntap: correctly set SOCKWQ_ASYNC_NOSPACE
  KVM: Check for a bad hva before dropping into the ghc slow path
  KVM: SVM: Override default MMIO mask if memory encryption is enabled
  mwifiex: drop most magic numbers from mwifiex_process_tdls_action_frame()
  namei: only return -ECHILD from follow_dotdot_rcu()
  net: ena: make ena rxfh support ETH_RSS_HASH_NO_CHANGE
  net: atlantic: fix potential error handling
  net: netlink: cap max groups which will be considered in netlink_bind()
  include/linux/bitops.h: introduce BITS_PER_TYPE
  ecryptfs: Fix up bad backport of fe2e082f5da5b4a0a92ae32978f81507ef37ec66
  usb: charger: assign specific number for enum value
  drm/i915/gvt: Separate display reset from ALL_ENGINES reset
  i2c: jz4780: silence log flood on txabrt
  i2c: altera: Fix potential integer overflow
  MIPS: VPE: Fix a double free and a memory leak in 'release_vpe()'
  HID: hiddev: Fix race in in hiddev_disconnect()
  Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs"
  tracing: Disable trace_printk() on post poned tests
  HID: core: increase HID report buffer size to 8KiB
  HID: core: fix off-by-one memset in hid_report_raw_event()
  HID: ite: Only bind to keyboard USB interface on Acer SW5-012 keyboard dock
  KVM: VMX: check descriptor table exits on instruction emulation
  ACPI: watchdog: Fix gas->access_width usage
  ACPICA: Introduce ACPI_ACCESS_BYTE_WIDTH() macro
  audit: fix error handling in audit_data_to_entry()
  ext4: potential crash on allocation error in ext4_alloc_flex_bg_array()
  net: sched: correct flower port blocking
  qede: Fix race between rdma destroy workqueue and link change event
  ipv6: Fix route replacement with dev-only route
  ipv6: Fix nlmsg_flags when splitting a multipath route
  sctp: move the format error check out of __sctp_sf_do_9_1_abort
  nfc: pn544: Fix occasional HW initialization failure
  net: phy: restore mdio regs in the iproc mdio driver
  net: fib_rules: Correctly set table field when table number exceeds 8 bits
  sysrq: Remove duplicated sysrq message
  sysrq: Restore original console_loglevel when sysrq disabled
  cfg80211: add missing policy for NL80211_ATTR_STATUS_CODE
  cifs: Fix mode output in debugging statements
  net: ena: ena-com.c: prevent NULL pointer dereference
  net: ena: ethtool: use correct value for crc32 hash
  net: ena: fix incorrectly saving queue numbers when setting RSS indirection table
  net: ena: rss: store hash function as values and not bits
  net: ena: rss: fix failure to get indirection table
  net: ena: fix incorrect default RSS key
  net: ena: add missing ethtool TX timestamping indication
  net: ena: fix uses of round_jiffies()
  net: ena: fix potential crash when rxfh key is NULL
  qmi_wwan: unconditionally reject 2 ep interfaces
  qmi_wwan: re-add DW5821e pre-production variant
  cfg80211: check wiphy driver existence for drvinfo report
  mac80211: consider more elements in parsing CRC
  dax: pass NOWAIT flag to iomap_apply
  drm/msm: Set dma maximum segment size for mdss
  ipmi:ssif: Handle a possible NULL pointer reference
  ext4: fix potential race between s_group_info online resizing and access
  ext4: fix potential race between s_flex_groups online resizing and access
  ext4: fix potential race between online resizing and write operations
  netfilter: nf_conntrack: resolve clash for matching conntracks
  iwlwifi: pcie: fix rb_allocator workqueue allocation
  FROMLIST: f2fs: fix wrong check on F2FS_IOC_FSSETXATTR
  UPSTREAM: binder: prevent UAF for binderfs devices II
  UPSTREAM: binder: prevent UAF for binderfs devices
  FROMLIST: lib: test_stackinit.c: XFAIL switch variable init tests
  ANDROID: cuttlefish: disable KPROBES
  ANDROID: scsi: ufs: allow ufs variants to override sg entry size
  FROMLIST: ufs: fix a bug on printing PRDT
  BACKPORT: loop: Add LOOP_SET_BLOCK_SIZE in compat ioctl
  ANDROID: fix build issue in security/selinux/avc.c
  ANDROID: cuttlefish_defconfig: Disable CONFIG_RT_GROUP_SCHED
  ANDROID: Enable HID_NINTENDO as y
  FROMLIST: HID: nintendo: add nintendo switch controller driver
  Linux 4.14.172
  s390/mm: Explicitly compare PAGE_DEFAULT_KEY against zero in storage_key_init_range
  xen: Enable interrupts when calling _cond_resched()
  ata: ahci: Add shutdown to freeze hardware resources of ahci
  netfilter: xt_hashlimit: limit the max size of hashtable
  ALSA: seq: Fix concurrent access to queue current tick/time
  ALSA: seq: Avoid concurrent access to queue flags
  ALSA: rawmidi: Avoid bit fields for state flags
  genirq/proc: Reject invalid affinity masks (again)
  iommu/vt-d: Fix compile warning from intel-svm.h
  ecryptfs: replace BUG_ON with error handling code
  staging: greybus: use after free in gb_audio_manager_remove_all()
  staging: rtl8723bs: fix copy of overlapping memory
  usb: gadget: composite: Fix bMaxPower for SuperSpeedPlus
  scsi: Revert "target: iscsi: Wait for all commands to finish before freeing a session"
  scsi: Revert "RDMA/isert: Fix a recently introduced regression related to logout"
  Btrfs: fix btrfs_wait_ordered_range() so that it waits for all ordered extents
  btrfs: do not check delayed items are empty for single transaction cleanup
  btrfs: fix bytes_may_use underflow in prealloc error condtition
  KVM: apic: avoid calculating pending eoi from an uninitialized val
  KVM: nVMX: handle nested posted interrupts when apicv is disabled for L1
  KVM: nVMX: Check IO instruction VM-exit conditions
  KVM: nVMX: Refactor IO bitmap checks into helper function
  ext4: fix race between writepages and enabling EXT4_EXTENTS_FL
  ext4: rename s_journal_flag_rwsem to s_writepages_rwsem
  ext4: fix mount failure with quota configured as module
  ext4: add cond_resched() to __ext4_find_entry()
  ext4: fix a data race in EXT4_I(inode)->i_disksize
  KVM: nVMX: Don't emulate instructions in guest mode
  lib/stackdepot.c: fix global out-of-bounds in stack_slabs
  serial: 8250: Check UPF_IRQ_SHARED in advance
  vt: vt_ioctl: fix race in VT_RESIZEX
  VT_RESIZEX: get rid of field-by-field copyin
  xhci: apply XHCI_PME_STUCK_QUIRK to Intel Comet Lake platforms
  KVM: x86: don't notify userspace IOAPIC on edge-triggered interrupt EOI
  drm/amdgpu/soc15: fix xclk for raven
  mm/vmscan.c: don't round up scan size for online memory cgroup
  Revert "ipc,sem: remove uneeded sem_undo_list lock usage in exit_sem()"
  MAINTAINERS: Update drm/i915 bug filing URL
  serdev: ttyport: restore client ops on deregistration
  tty: serial: imx: setup the correct sg entry for tx dma
  tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode
  x86/mce/amd: Fix kobject lifetime
  x86/mce/amd: Publish the bank pointer only after setup has succeeded
  staging: rtl8723bs: Fix potential overuse of kernel memory
  staging: rtl8723bs: Fix potential security hole
  staging: rtl8188eu: Fix potential overuse of kernel memory
  staging: rtl8188eu: Fix potential security hole
  USB: hub: Fix the broken detection of USB3 device in SMSC hub
  USB: hub: Don't record a connect-change event during reset-resume
  USB: Fix novation SourceControl XL after suspend
  usb: uas: fix a plug & unplug racing
  usb: host: xhci: update event ring dequeue pointer on purpose
  xhci: fix runtime pm enabling for quirky Intel hosts
  xhci: Force Maximum Packet size for Full-speed bulk devices to valid range.
  staging: vt6656: fix sign of rx_dbm to bb_pre_ed_rssi.
  staging: android: ashmem: Disallow ashmem memory from being remapped
  vt: selection, handle pending signals in paste_selection
  floppy: check FDC index for errors before assigning it
  USB: misc: iowarrior: add support for the 100 device
  USB: misc: iowarrior: add support for the 28 and 28L devices
  USB: misc: iowarrior: add support for 2 OEMed devices
  thunderbolt: Prevent crash if non-active NVMem file is read
  net/smc: fix leak of kernel memory to user space
  net/sched: flower: add missing validation of TCA_FLOWER_FLAGS
  net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS
  net: dsa: tag_qca: Make sure there is headroom for tag
  enic: prevent waking up stopped tx queues over watchdog reset
  selinux: ensure we cleanup the internal AVC counters on error in avc_update()
  mlxsw: spectrum_dpipe: Add missing error path
  virtio_balloon: prevent pfn array overflow
  help_next should increase position index
  brd: check and limit max_part par
  microblaze: Prevent the overflow of the start
  iwlwifi: mvm: Fix thermal zone registration
  irqchip/gic-v3-its: Reference to its_invall_cmd descriptor when building INVALL
  bcache: explicity type cast in bset_bkey_last()
  reiserfs: prevent NULL pointer dereference in reiserfs_insert_item()
  lib/scatterlist.c: adjust indentation in __sg_alloc_table
  ocfs2: fix a NULL pointer dereference when call ocfs2_update_inode_fsync_trans()
  radeon: insert 10ms sleep in dce5_crtc_load_lut
  trigger_next should increase position index
  ftrace: fpid_next() should increase position index
  drm/nouveau/disp/nv50-: prevent oops when no channel method map provided
  irqchip/gic-v3: Only provision redistributors that are enabled in ACPI
  ceph: check availability of mds cluster on mount after wait timeout
  cifs: fix NULL dereference in match_prepath
  iwlegacy: ensure loop counter addr does not wrap and cause an infinite loop
  hostap: Adjust indentation in prism2_hostapd_add_sta
  ARM: 8951/1: Fix Kexec compilation issue.
  jbd2: make sure ESHUTDOWN to be recorded in the journal superblock
  jbd2: switch to use jbd2_journal_abort() when failed to submit the commit record
  powerpc/sriov: Remove VF eeh_dev state when disabling SR-IOV
  ALSA: hda - Add docking station support for Lenovo Thinkpad T420s
  driver core: platform: fix u32 greater or equal to zero comparison
  s390/ftrace: generate traced function stack frame
  x86/decoder: Add TEST opcode to Group3-2
  ALSA: hda/hdmi - add retry logic to parse_intel_hdmi()
  irqchip/mbigen: Set driver .suppress_bind_attrs to avoid remove problems
  remoteproc: Initialize rproc_class before use
  btrfs: device stats, log when stats are zeroed
  btrfs: safely advance counter when looking up bio csums
  btrfs: fix possible NULL-pointer dereference in integrity checks
  pwm: Remove set but not set variable 'pwm'
  ide: serverworks: potential overflow in svwks_set_pio_mode()
  cmd64x: potential buffer overflow in cmd64x_program_timings()
  pwm: omap-dmtimer: Remove PWM chip in .remove before making it unfunctional
  x86/mm: Fix NX bit clearing issue in kernel_map_pages_in_pgd
  f2fs: fix memleak of kobject
  watchdog/softlockup: Enforce that timestamp is valid on boot
  arm64: fix alternatives with LLVM's integrated assembler
  scsi: iscsi: Don't destroy session if there are outstanding connections
  f2fs: free sysfs kobject
  iommu/arm-smmu-v3: Use WRITE_ONCE() when changing validity of an STE
  usb: musb: omap2430: Get rid of musb .set_vbus for omap2430 glue
  drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add
  drm/nouveau: Fix copy-paste error in nouveau_fence_wait_uevent_handler
  drm/nouveau/gr/gk20a,gm200-: add terminators to method lists read from fw
  drm/nouveau/secboot/gm20b: initialize pointer in gm20b_secboot_new()
  vme: bridges: reduce stack usage
  driver core: Print device when resources present in really_probe()
  driver core: platform: Prevent resouce overflow from causing infinite loops
  tty: synclink_gt: Adjust indentation in several functions
  tty: synclinkmp: Adjust indentation in several functions
  ASoC: atmel: fix build error with CONFIG_SND_ATMEL_SOC_DMA=m
  wan: ixp4xx_hss: fix compile-testing on 64-bit
  Input: edt-ft5x06 - work around first register access error
  rcu: Use WRITE_ONCE() for assignments to ->pprev for hlist_nulls
  efi/x86: Don't panic or BUG() on non-critical error conditions
  soc/tegra: fuse: Correct straps' address for older Tegra124 device trees
  IB/hfi1: Add software counter for ctxt0 seq drop
  udf: Fix free space reporting for metadata and virtual partitions
  usbip: Fix unsafe unaligned pointer usage
  drm: remove the newline for CRC source name.
  tools lib api fs: Fix gcc9 stringop-truncation compilation error
  ALSA: sh: Fix compile warning wrt const
  ALSA: sh: Fix unused variable warnings
  clk: sunxi-ng: add mux and pll notifiers for A64 CPU clock
  RDMA/rxe: Fix error type of mmap_offset
  pinctrl: sh-pfc: sh7269: Fix CAN function GPIOs
  PM / devfreq: rk3399_dmc: Add COMPILE_TEST and HAVE_ARM_SMCCC dependency
  x86/vdso: Provide missing include file
  dmaengine: Store module owner in dma_device struct
  ARM: dts: r8a7779: Add device node for ARM global timer
  drm/mediatek: handle events when enabling/disabling crtc
  scsi: aic7xxx: Adjust indentation in ahc_find_syncrate
  scsi: ufs: Complete pending requests in host reset and restore path
  ACPICA: Disassembler: create buffer fields in ACPI_PARSE_LOAD_PASS1
  orinoco: avoid assertion in case of NULL pointer
  rtlwifi: rtl_pci: Fix -Wcast-function-type
  iwlegacy: Fix -Wcast-function-type
  ipw2x00: Fix -Wcast-function-type
  b43legacy: Fix -Wcast-function-type
  ALSA: usx2y: Adjust indentation in snd_usX2Y_hwdep_dsp_status
  fore200e: Fix incorrect checks of NULL pointer dereference
  reiserfs: Fix spurious unlock in reiserfs_fill_super() error handling
  media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros
  ARM: dts: imx6: rdu2: Disable WP for USDHC2 and USDHC3
  arm64: dts: qcom: msm8996: Disable USB2 PHY suspend by core
  NFC: port100: Convert cpu_to_le16(le16_to_cpu(E1) + E2) to use le16_add_cpu().
  PCI/IOV: Fix memory leak in pci_iov_add_virtfn()
  net/wan/fsl_ucc_hdlc: reject muram offsets above 64K
  regulator: rk808: Lower log level on optional GPIOs being not available
  drm/amdgpu: remove 4 set but not used variable in amdgpu_atombios_get_connector_info_from_object_table
  clk: qcom: rcg2: Don't crash if our parent can't be found; return an error
  kconfig: fix broken dependency in randconfig-generated .config
  KVM: s390: ENOTSUPP -> EOPNOTSUPP fixups
  nbd: add a flush_workqueue in nbd_start_device
  ext4, jbd2: ensure panic when aborting with zero errno
  tracing: Fix very unlikely race of registering two stat tracers
  tracing: Fix tracing_stat return values in error handling paths
  x86/sysfb: Fix check for bad VRAM size
  jbd2: clear JBD2_ABORT flag before journal_reset to update log tail info when load journal
  kselftest: Minimise dependency of get_size on C library interfaces
  clocksource/drivers/bcm2835_timer: Fix memory leak of timer
  usb: dwc2: Fix IN FIFO allocation
  usb: gadget: udc: fix possible sleep-in-atomic-context bugs in gr_probe()
  uio: fix a sleep-in-atomic-context bug in uio_dmem_genirq_irqcontrol()
  sparc: Add .exit.data section.
  MIPS: Loongson: Fix potential NULL dereference in loongson3_platform_init()
  efi/x86: Map the entire EFI vendor string before copying it
  pinctrl: baytrail: Do not clear IRQ flags on direct-irq enabled pins
  media: sti: bdisp: fix a possible sleep-in-atomic-context bug in bdisp_device_run()
  char/random: silence a lockdep splat with printk()
  gpio: gpio-grgpio: fix possible sleep-in-atomic-context bugs in grgpio_irq_map/unmap()
  powerpc/powernv/iov: Ensure the pdn for VFs always contains a valid PE number
  media: i2c: mt9v032: fix enum mbus codes and frame sizes
  pxa168fb: Fix the function used to release some memory in an error handling path
  pinctrl: sh-pfc: sh7264: Fix CAN function GPIOs
  gianfar: Fix TX timestamping with a stacked DSA driver
  ALSA: ctl: allow TLV read operation for callback type of element in locked case
  ext4: fix ext4_dax_read/write inode locking sequence for IOCB_NOWAIT
  leds: pca963x: Fix open-drain initialization
  brcmfmac: Fix use after free in brcmf_sdio_readframes()
  cpu/hotplug, stop_machine: Fix stop_machine vs hotplug order
  drm/gma500: Fixup fbdev stolen size usage evaluation
  KVM: nVMX: Use correct root level for nested EPT shadow page tables
  Revert "KVM: VMX: Add non-canonical check on writes to RTIT address MSRs"
  Revert "KVM: nVMX: Use correct root level for nested EPT shadow page tables"
  scsi: qla2xxx: fix a potential NULL pointer dereference
  jbd2: do not clear the BH_Mapped flag when forgetting a metadata buffer
  jbd2: move the clearing of b_modified flag to the journal_unmap_buffer()
  hwmon: (pmbus/ltc2978) Fix PMBus polling of MFR_COMMON definitions.
  perf/x86/intel: Fix inaccurate period in context switch for auto-reload
  s390/time: Fix clk type in get_tod_clock
  RDMA/core: Fix protection fault in get_pkey_idx_qp_list
  IB/hfi1: Close window for pq and request coliding
  serial: imx: Only handle irqs that are actually enabled
  serial: imx: ensure that RX irqs are off if RX is off
  padata: Remove broken queue flushing
  perf/x86/amd: Add missing L2 misses event spec to AMD Family 17h's event map
  KVM: nVMX: Use correct root level for nested EPT shadow page tables
  arm64: ssbs: Fix context-switch when SSBS is present on all CPUs
  btrfs: log message when rw remount is attempted with unclean tree-log
  btrfs: print message when tree-log replay starts
  Btrfs: fix race between using extent maps and merging them
  ext4: improve explanation of a mount failure caused by a misconfigured kernel
  ext4: fix checksum errors with indexed dirs
  ext4: fix support for inode sizes > 1024 bytes
  ext4: don't assume that mmp_nodename/bdevname have NUL
  ARM: 8723/2: always assume the "unified" syntax for assembly code
  arm64: nofpsimd: Handle TIF_FOREIGN_FPSTATE flag cleanly
  arm64: ptrace: nofpsimd: Fail FP/SIMD regset operations
  arm64: cpufeature: Set the FP/SIMD compat HWCAP bits properly
  ALSA: usb-audio: Apply sample rate quirk for Audioengine D1
  Input: synaptics - remove the LEN0049 dmi id from topbuttonpad list
  Input: synaptics - enable SMBus on ThinkPad L470
  Input: synaptics - switch T470s to RMI4 by default
  ecryptfs: fix a memory leak bug in ecryptfs_init_messaging()
  ecryptfs: fix a memory leak bug in parse_tag_1_packet()
  ASoC: sun8i-codec: Fix setting DAI data format
  ALSA: hda: Use scnprintf() for printing texts for sysfs/procfs
  iommu/qcom: Fix bogus detach logic
  KVM: x86: emulate RDPID
  UPSTREAM: sched/psi: Fix OOB write when writing 0 bytes to PSI files
  UPSTREAM: psi: Fix a division error in psi poll()
  UPSTREAM: sched/psi: Fix sampling error and rare div0 crashes with cgroups and high uptime
  UPSTREAM: sched/psi: Correct overly pessimistic size calculation
  FROMLIST: f2fs: Handle casefolding with Encryption
  FROMLIST: fscrypt: Have filesystems handle their d_ops
  FROMLIST: ext4: Use generic casefolding support
  FROMLIST: f2fs: Use generic casefolding support
  FROMLIST: Add standard casefolding support
  FROMLIST: unicode: Add utf8_casefold_hash
  ANDROID: cuttlefish_defconfig: Add CONFIG_UNICODE
  ANDROID: sdcardfs: fix -ENOENT lookup race issue
  ANDROID: gki_defconfig: Enable CONFIG_RD_LZ4
  ANDROID: dm: Add wrapped key support in dm-default-key
  ANDROID: dm: add support for passing through derive_raw_secret
  ANDROID: block: Prevent crypto fallback for wrapped keys
  ANDROID: Disable wq fp check in CFI builds
  ANDROID: increase limit on sched-tune boost groups
  ANDROID: ufs, block: fix crypto power management and move into block layer
  ANDROID: Incremental fs: Support xattrs
  ANDROID: test_stackinit: work around LLVM PR44916
  ANDROID: clang: update to 10.0.4
  fs-verity: use u64_to_user_ptr()
  fs-verity: use mempool for hash requests
  fs-verity: implement readahead of Merkle tree pages
  ext4: readpages() should submit IO as read-ahead
  fs-verity: implement readahead for FS_IOC_ENABLE_VERITY
  fscrypt: improve format of no-key names
  ubifs: allow both hash and disk name to be provided in no-key names
  ubifs: don't trigger assertion on invalid no-key filename
  fscrypt: clarify what is meant by a per-file key
  fscrypt: derive dirhash key for casefolded directories
  fscrypt: don't allow v1 policies with casefolding
  fscrypt: add "fscrypt_" prefix to fname_encrypt()
  fscrypt: don't print name of busy file when removing key
  fscrypt: document gfp_flags for bounce page allocation
  fscrypt: optimize fscrypt_zeroout_range()
  fscrypt: remove redundant bi_status check
  fscrypt: Allow modular crypto algorithms
  fscrypt: include <linux/ioctl.h> in UAPI header
  fscrypt: don't check for ENOKEY from fscrypt_get_encryption_info()
  fscrypt: remove fscrypt_is_direct_key_policy()
  fscrypt: move fscrypt_valid_enc_modes() to policy.c
  fscrypt: check for appropriate use of DIRECT_KEY flag earlier
  fscrypt: split up fscrypt_supported_policy() by policy version
  fscrypt: introduce fscrypt_needs_contents_encryption()
  fscrypt: move fscrypt_d_revalidate() to fname.c
  fscrypt: constify inode parameter to filename encryption functions
  fscrypt: constify struct fscrypt_hkdf parameter to fscrypt_hkdf_expand()
  fscrypt: verify that the crypto_skcipher has the correct ivsize
  fscrypt: use crypto_skcipher_driver_name()
  fscrypt: support passing a keyring key to FS_IOC_ADD_ENCRYPTION_KEY
  keys: Export lookup_user_key to external users
  f2fs: fix build error on PAGE_KERNEL_RO

 Conflicts:
	arch/arm64/kernel/smp.c
	arch/arm64/kernel/traps.c
	block/blk-crypto-fallback.c
	block/keyslot-manager.c
	drivers/base/power/wakeup.c
	drivers/clk/clk.c
	drivers/clk/qcom/clk-rcg2.c
	drivers/gpu/Makefile
	drivers/gpu/drm/msm/msm_drv.c
	drivers/gpu/drm/msm/msm_gem.c
	drivers/hwtracing/coresight/coresight-funnel.c
	drivers/irqchip/irq-gic-v3.c
	drivers/md/dm.c
	drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
	drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
	drivers/net/macsec.c
	drivers/net/phy/micrel.c
	drivers/net/wireless/ath/wil6210/cfg80211.c
	drivers/net/wireless/ath/wil6210/fw_inc.c
	drivers/net/wireless/ath/wil6210/pcie_bus.c
	drivers/net/wireless/ath/wil6210/pm.c
	drivers/net/wireless/ath/wil6210/wil6210.h
	drivers/of/base.c
	drivers/power/supply/power_supply_sysfs.c
	drivers/rpmsg/qcom_glink_smem.c
	drivers/scsi/sd.c
	drivers/scsi/ufs/ufshcd-crypto.c
	drivers/scsi/ufs/ufshcd.c
	drivers/scsi/ufs/ufshcd.h
	drivers/scsi/ufs/ufshci.h
	drivers/usb/dwc3/core.c
	drivers/usb/dwc3/gadget.c
	drivers/usb/gadget/Kconfig
	drivers/usb/gadget/composite.c
	drivers/usb/gadget/function/f_fs.c
	drivers/usb/gadget/legacy/Makefile
	drivers/usb/host/xhci-mem.c
	fs/ext4/readpage.c
	fs/sdcardfs/lookup.c
	include/linux/key.h
	include/linux/keyslot-manager.h
	include/linux/power_supply.h
	include/uapi/linux/coresight-stm.h
	net/qrtr/qrtr.c

Change-Id: Iaa9fcbe987e721f02596e167249a519781ed3888
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2020-08-05 11:41:56 +05:30
Greg Kroah-Hartman
95495cdf37 Merge 4.14.177 into android-4.14-stable
Changes in 4.14.177
	bus: sunxi-rsb: Return correct data when mixing 16-bit and 8-bit reads
	net: vxge: fix wrong __VA_ARGS__ usage
	hinic: fix a bug of waitting for IO stopped
	hinic: fix wrong para of wait_for_completion_timeout
	cxgb4/ptp: pass the sign of offset delta in FW CMD
	qlcnic: Fix bad kzalloc null test
	i2c: st: fix missing struct parameter description
	null_blk: Fix the null_add_dev() error path
	null_blk: Handle null_add_dev() failures properly
	null_blk: fix spurious IO errors after failed past-wp access
	x86: Don't let pgprot_modify() change the page encryption bit
	block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices
	irqchip/versatile-fpga: Handle chained IRQs properly
	sched: Avoid scale real weight down to zero
	selftests/x86/ptrace_syscall_32: Fix no-vDSO segfault
	PCI/switchtec: Fix init_completion race condition with poll_wait()
	libata: Remove extra scsi_host_put() in ata_scsi_add_hosts()
	gfs2: Don't demote a glock until its revokes are written
	x86/boot: Use unsigned comparison for addresses
	efi/x86: Ignore the memory attributes table on i386
	genirq/irqdomain: Check pointer in irq_domain_alloc_irqs_hierarchy()
	block: Fix use-after-free issue accessing struct io_cq
	usb: dwc3: core: add support for disabling SS instances in park mode
	irqchip/gic-v4: Provide irq_retrigger to avoid circular locking dependency
	locking/lockdep: Avoid recursion in lockdep_count_{for,back}ward_deps()
	block, bfq: fix use-after-free in bfq_idle_slice_timer_body
	btrfs: remove a BUG_ON() from merge_reloc_roots()
	btrfs: track reloc roots based on their commit root bytenr
	uapi: rename ext2_swab() to swab() and share globally in swab.h
	misc: rtsx: set correct pcr_ops for rts522A
	slub: improve bit diffusion for freelist ptr obfuscation
	ASoC: fix regwmask
	ASoC: dapm: connect virtual mux with default value
	ASoC: dpcm: allow start or stop during pause for backend
	ASoC: topology: use name_prefix for new kcontrol
	usb: gadget: f_fs: Fix use after free issue as part of queue failure
	usb: gadget: composite: Inform controller driver of self-powered
	ALSA: usb-audio: Add mixer workaround for TRX40 and co
	ALSA: hda: Add driver blacklist
	ALSA: hda: Fix potential access overflow in beep helper
	ALSA: ice1724: Fix invalid access for enumerated ctl items
	ALSA: pcm: oss: Fix regression by buffer overflow fix
	ALSA: doc: Document PC Beep Hidden Register on Realtek ALC256
	ALSA: hda/realtek - Set principled PC Beep configuration for ALC256
	media: ti-vpe: cal: fix disable_irqs to only the intended target
	acpi/x86: ignore unspecified bit positions in the ACPI global lock field
	thermal: devfreq_cooling: inline all stubs for CONFIG_DEVFREQ_THERMAL=n
	nvme-fc: Revert "add module to ops template to allow module references"
	PCI/ASPM: Clear the correct bits when enabling L1 substates
	PCI: endpoint: Fix for concurrent memory allocation in OB address region
	KEYS: reaching the keys quotas correctly
	irqchip/versatile-fpga: Apply clear-mask earlier
	MIPS: OCTEON: irq: Fix potential NULL pointer dereference
	ath9k: Handle txpower changes even when TPC is disabled
	signal: Extend exec_id to 64bits
	x86/entry/32: Add missing ASM_CLAC to general_protection entry
	KVM: nVMX: Properly handle userspace interrupt window request
	KVM: s390: vsie: Fix region 1 ASCE sanity shadow address checks
	KVM: s390: vsie: Fix delivery of addressing exceptions
	KVM: x86: Allocate new rmap and large page tracking when moving memslot
	KVM: VMX: Always VMCLEAR in-use VMCSes during crash with kexec support
	KVM: VMX: fix crash cleanup when KVM wasn't used
	CIFS: Fix bug which the return value by asynchronous read is error
	btrfs: drop block from cache on error in relocation
	crypto: mxs-dcp - fix scatterlist linearization for hash
	ALSA: hda: Initialize power_state field properly
	net: rtnl_configure_link: fix dev flags changes arg to __dev_notify_flags
	powerpc/pseries: Drop pointless static qualifier in vpa_debugfs_init()
	x86/speculation: Remove redundant arch_smt_update() invocation
	tools: gpio: Fix out-of-tree build regression
	mm: Use fixed constant in page_frag_alloc instead of size + 1
	dm verity fec: fix memory leak in verity_fec_dtr
	scsi: zfcp: fix missing erp_lock in port recovery trigger for point-to-point
	arm64: armv8_deprecated: Fix undef_hook mask for thumb setend
	rtc: omap: Use define directive for PIN_CONFIG_ACTIVE_HIGH
	NFS: Fix a page leak in nfs_destroy_unlinked_subrequests()
	ext4: fix a data race at inode->i_blocks
	fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once()
	ocfs2: no need try to truncate file beyond i_size
	perf tools: Support Python 3.8+ in Makefile
	s390/diag: fix display of diagnose call statistics
	Input: i8042 - add Acer Aspire 5738z to nomux list
	kmod: make request_module() return an error when autoloading is disabled
	cpufreq: powernv: Fix use-after-free
	hfsplus: fix crash and filesystem corruption when deleting files
	libata: Return correct status in sata_pmp_eh_recover_pm() when ATA_DFLAG_DETACH is set
	powerpc/powernv/idle: Restore AMR/UAMOR/AMOR after idle
	powerpc/64/tm: Don't let userspace set regs->trap via sigreturn
	powerpc/hash64/devmap: Use H_PAGE_THP_HUGE when setting up huge devmap PTE entries
	powerpc/xive: Use XIVE_BAD_IRQ instead of zero to catch non configured IPIs
	powerpc/kprobes: Ignore traps that happened in real mode
	scsi: mpt3sas: Fix kernel panic observed on soft HBA unplug
	powerpc: Add attributes for setjmp/longjmp
	powerpc: Make setjmp/longjmp signature standard
	Btrfs: fix crash during unmount due to race with delayed inode workers
	btrfs: use nofs allocations for running delayed items
	dm zoned: remove duplicate nr_rnd_zones increase in dmz_init_zone()
	crypto: caam - update xts sector size for large input length
	drm/dp_mst: Fix clearing payload state on topology disable
	drm: Remove PageReserved manipulation from drm_pci_alloc
	ftrace/kprobe: Show the maxactive number on kprobe_events
	ipmi: fix hung processes in __get_guid()
	powerpc/fsl_booke: Avoid creating duplicate tlb1 entry
	misc: echo: Remove unnecessary parentheses and simplify check for zero
	mfd: dln2: Fix sanity checking for endpoints
	amd-xgbe: Use __napi_schedule() in BH context
	hsr: check protocol version in hsr_newlink()
	net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin
	net: ipv6: do not consider routes via gateways for anycast address check
	net: qrtr: send msgs from local of same id as broadcast
	net: revert default NAPI poll timeout to 2 jiffies
	net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes
	scsi: ufs: Fix ufshcd_hold() caused scheduling while atomic
	jbd2: improve comments about freeing data buffers whose page mapping is NULL
	pwm: pca9685: Fix PWM/GPIO inter-operation
	ext4: fix incorrect group count in ext4_fill_super error message
	ext4: fix incorrect inodes per group in error message
	ASoC: Intel: mrfld: fix incorrect check on p->sink
	ASoC: Intel: mrfld: return error codes when an error occurs
	ALSA: usb-audio: Don't override ignore_ctl_error value from the map
	tracing: Fix the race between registering 'snapshot' event trigger and triggering 'snapshot' operation
	btrfs: check commit root generation in should_ignore_root
	mac80211_hwsim: Use kstrndup() in place of kasprintf()
	ext4: do not zeroout extents beyond i_disksize
	dm flakey: check for null arg_name in parse_features()
	kvm: x86: Host feature SSBD doesn't imply guest feature SPEC_CTRL_SSBD
	scsi: target: remove boilerplate code
	scsi: target: fix hang when multiple threads try to destroy the same iscsi session
	x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE
	x86/intel_rdt: Enumerate L2 Code and Data Prioritization (CDP) feature
	x86/intel_rdt: Add two new resources for L2 Code and Data Prioritization (CDP)
	x86/intel_rdt: Enable L2 CDP in MSR IA32_L2_QOS_CFG
	x86/resctrl: Preserve CDP enable over CPU hotplug
	x86/resctrl: Fix invalid attempt at removing the default resource group
	mm/vmalloc.c: move 'area->pages' after if statement
	objtool: Fix switch table detection in .text.unlikely
	scsi: sg: add sg_remove_request in sg_common_write
	ext4: use non-movable memory for superblock readahead
	arm, bpf: Fix bugs with ALU64 {RSH, ARSH} BPF_K shift by 0
	netfilter: nf_tables: report EOPNOTSUPP on unsupported flags/object type
	irqchip/mbigen: Free msi_desc on device teardown
	ALSA: hda: Don't release card at firmware loading error
	lib/raid6: use vdupq_n_u8 to avoid endianness warnings
	video: fbdev: sis: Remove unnecessary parentheses and commented code
	drm: NULL pointer dereference [null-pointer-deref] (CWE 476) problem
	clk: Fix debugfs_create_*() usage
	Revert "gpio: set up initial state from .get_direction()"
	arm64: perf: remove unsupported events for Cortex-A73
	arm64: traps: Don't print stack or raw PC/LR values in backtraces
	arch_topology: Fix section miss match warning due to free_raw_capacity()
	wil6210: increase firmware ready timeout
	wil6210: fix temperature debugfs
	scsi: ufs: make sure all interrupts are processed
	scsi: ufs: ufs-qcom: remove broken hci version quirk
	wil6210: rate limit wil_rx_refill error
	rpmsg: glink: use put_device() if device_register fail
	rtc: pm8xxx: Fix issue in RTC write path
	rpmsg: glink: Fix missing mutex_init() in qcom_glink_alloc_channel()
	rpmsg: glink: smem: Ensure ordering during tx
	wil6210: fix PCIe bus mastering in case of interface down
	wil6210: add block size checks during FW load
	wil6210: fix length check in __wmi_send
	wil6210: abort properly in cfg suspend
	soc: qcom: smem: Use le32_to_cpu for comparison
	of: fix missing kobject init for !SYSFS && OF_DYNAMIC config
	rbd: avoid a deadlock on header_rwsem when flushing notifies
	rbd: call rbd_dev_unprobe() after unwatching and flushing notifies
	of: unittest: kmemleak in of_unittest_platform_populate()
	clk: at91: usb: continue if clk_hw_round_rate() return zero
	power: supply: bq27xxx_battery: Silence deferred-probe error
	clk: tegra: Fix Tegra PMC clock out parents
	soc: imx: gpc: fix power up sequencing
	rtc: 88pm860x: fix possible race condition
	NFSv4/pnfs: Return valid stateids in nfs_layout_find_inode_by_stateid()
	NFS: direct.c: Fix memory leak of dreq when nfs_get_lock_context fails
	s390/cpuinfo: fix wrong output when CPU0 is offline
	powerpc/maple: Fix declaration made after definition
	ext4: do not commit super on read-only bdev
	include/linux/swapops.h: correct guards for non_swap_entry()
	percpu_counter: fix a data race at vm_committed_as
	compiler.h: fix error in BUILD_BUG_ON() reporting
	KVM: s390: vsie: Fix possible race when shadowing region 3 tables
	x86: ACPI: fix CPU hotplug deadlock
	drm/amdkfd: kfree the wrong pointer
	NFS: Fix memory leaks in nfs_pageio_stop_mirroring()
	iommu/vt-d: Fix mm reference leak
	ext2: fix empty body warnings when -Wextra is used
	ext2: fix debug reference to ext2_xattr_cache
	libnvdimm: Out of bounds read in __nd_ioctl()
	iommu/amd: Fix the configuration of GCR3 table root pointer
	net: dsa: bcm_sf2: Fix overflow checks
	fbdev: potential information leak in do_fb_ioctl()
	tty: evh_bytechan: Fix out of bounds accesses
	locktorture: Print ratio of acquisitions, not failures
	mtd: lpddr: Fix a double free in probe()
	mtd: phram: fix a double free issue in error path
	KEYS: Use individual pages in big_key for crypto buffers
	KEYS: Don't write out to userspace while holding key semaphore
	Linux 4.14.177

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5eb89921eb63ee9e92a031fc6f3a10d9e2616358
2020-04-24 08:41:10 +02:00
Roman Gushchin
73a55c0a66 ext4: use non-movable memory for superblock readahead
commit d87f639258a6a5980183f11876c884931ad93da2 upstream.

Since commit a8ac900b81 ("ext4: use non-movable memory for the
superblock") buffers for ext4 superblock were allocated using
the sb_bread_unmovable() helper which allocated buffer heads
out of non-movable memory blocks. It was necessarily to not block
page migrations and do not cause cma allocation failures.

However commit 85c8f176a6 ("ext4: preload block group descriptors")
broke this by introducing pre-reading of the ext4 superblock.
The problem is that __breadahead() is using __getblk() underneath,
which allocates buffer heads out of movable memory.

It resulted in page migration failures I've seen on a machine
with an ext4 partition and a preallocated cma area.

Fix this by introducing sb_breadahead_unmovable() and
__breadahead_gfp() helpers which use non-movable memory for buffer
head allocations and use them for the ext4 superblock readahead.

Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Fixes: 85c8f176a6 ("ext4: preload block group descriptors")
Signed-off-by: Roman Gushchin <guro@fb.com>
Link: https://lore.kernel.org/r/20200229001411.128010-1-guro@fb.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-24 08:01:00 +02:00
Satya Tangirala
e12563c18d BACKPORT: FROMLIST: Update Inline Encryption from v5 to v6 of patch series
Changes v5 => v6:
 - Blk-crypto's kernel crypto API fallback is no longer restricted to
   8-byte DUNs. It's also now separately configurable from blk-crypto, and
   can be disabled entirely, while still allowing the kernel to use inline
   encryption hardware. Further, struct bio_crypt_ctx takes up less space,
   and no longer contains the information needed by the crypto API
   fallback - the fallback allocates the required memory when necessary.
 - Blk-crypto now supports all file content encryption modes supported by
   fscrypt.
 - Fixed bio merging logic in blk-merge.c
 - Fscrypt now supports inline encryption with the direct key policy, since
   blk-crypto now has support for larger DUNs.
 - Keyslot manager now uses a hashtable to lookup which keyslot contains
   any particular key (thanks Eric!)
 - Fscrypt support for inline encryption now handles filesystems with
   multiple underlying block devices (thanks Eric!)
 - Numerous cleanups

Backport notes: In the time between the update from v5 to v6,
"scsi: ufs: override auto suspend tunables for ufs" was merged in
upstream, and as a result, UFSHCD_CAP_RPM_AUTOSUSPEND took up the
7th bit in the ufs crypto caps - however, that patch has not been
backported to 4.14 yet, so we manually change UFSHCD_CAP_CRYPTO to
use the 8th bit (to reflect what's in v6 in android-mainline).

Bug: 137270441
Test: refer to I26376479ee38259b8c35732cb3a1d7e15f9b05a3
Change-Id: I13e2e327e0b4784b394cb1e7cf32a04856d95f01
Link: https://lore.kernel.org/linux-block/20191218145136.172774-1-satyat@google.com/
Signed-off-by: Satya Tangirala <satyat@google.com>
2020-02-05 16:16:38 -08:00
Eric Biggers
b8f7b23674 BACKPORT: FROMLIST: ext4: add inline encryption support
Wire up ext4 to support inline encryption via the helper functions which
fs/crypto/ now provides.  This includes:

- Adding a mount option 'inlinecrypt' which enables inline encryption
  on encrypted files where it can be used.

- Setting the bio_crypt_ctx on bios that will be submitted to an
  inline-encrypted file.

  Note: submit_bh_wbc() in fs/buffer.c also needed to be patched for
  this part, since ext4 sometimes uses ll_rw_block() on file data.

- Not adding logically discontiguous data to bios that will be submitted
  to an inline-encrypted file.

- Not doing filesystem-layer crypto on inline-encrypted files.

Bug: 137270441
Test: tested as series; see Ie1b77f7615d6a7a60fdc9105c7ab2200d17636a8
Change-Id: I73dac46ff1eba56a13975c387b20554416ddbad8
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Satya Tangirala <satyat@google.com>
Link: https://lore.kernel.org/linux-fscrypt/20191028072032.6911-10-satyat@google.com/
2020-02-05 16:16:38 -08:00
Blagovest Kolenichev
5d880f1ba0 Merge android-4.14.111 (171fc23) into msm-4.14
* refs/heads/tmp-171fc23:
  Revert "usb: dwc3: gadget: Fix OTG events when gadget driver isn't loaded"
  Revert "coresight: etm4x: Add support to enable ETMv4.2"
  Linux 4.14.111
  ACPI / video: Extend chassis-type detection with a "Lunch Box" check
  drm/dp/mst: Configure no_stop_bit correctly for remote i2c xfers
  dmaengine: tegra: avoid overflow of byte tracking
  clk: rockchip: fix frac settings of GPLL clock for rk3328
  x86/build: Mark per-CPU symbols as absolute explicitly for LLD
  wlcore: Fix memory leak in case wl12xx_fetch_firmware failure
  selinux: do not override context on context mounts
  x86/build: Specify elf_i386 linker emulation explicitly for i386 objects
  drm/nouveau: Stop using drm_crtc_force_disable
  drm: Auto-set allow_fb_modifiers when given modifiers at plane init
  regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting
  media: s5p-jpeg: Check for fmt_ver_flag when doing fmt enumeration
  netfilter: physdev: relax br_netfilter dependency
  dmaengine: qcom_hidma: initialize tx flags in hidma_prep_dma_*
  dmaengine: qcom_hidma: assign channel cookie correctly
  dmaengine: imx-dma: fix warning comparison of distinct pointer types
  cpu/hotplug: Mute hotplug lockdep during init
  hpet: Fix missing '=' character in the __setup() code of hpet_mmap_enable
  HID: intel-ish: ipc: handle PIMR before ish_wakeup also clear PISR busy_clear bit
  soc/tegra: fuse: Fix illegal free of IO base address
  hwrng: virtio - Avoid repeated init of completion
  media: mt9m111: set initial frame size other than 0x0
  usb: dwc3: gadget: Fix OTG events when gadget driver isn't loaded
  powerpc/pseries: Perform full re-add of CPU for topology update post-migration
  tty: increase the default flip buffer limit to 2*640K
  backlight: pwm_bl: Use gpiod_get_value_cansleep() to get initial state
  cgroup/pids: turn cgroup_subsys->free() into cgroup_subsys->release() to fix the accounting
  bpf: fix missing prototype warnings
  ARM: avoid Cortex-A9 livelock on tight dmb loops
  ARM: 8830/1: NOMMU: Toggle only bits in EXC_RETURN we are really care of
  mt7601u: bump supported EEPROM version
  soc: qcom: gsbi: Fix error handling in gsbi_probe()
  efi/arm/arm64: Allow SetVirtualAddressMap() to be omitted
  ARM: dts: lpc32xx: Remove leading 0x and 0s from bindings notation
  efi/memattr: Don't bail on zero VA if it equals the region's PA
  sched/debug: Initialize sd_sysctl_cpus if !CONFIG_CPUMASK_OFFSTACK
  ASoC: fsl-asoc-card: fix object reference leaks in fsl_asoc_card_probe
  platform/x86: intel_pmc_core: Fix PCH IP sts reading
  e1000e: fix cyclic resets at link up with active tx
  cdrom: Fix race condition in cdrom_sysctl_register
  fbdev: fbmem: fix memory access if logo is bigger than the screen
  iw_cxgb4: fix srqidx leak during connection abort
  genirq: Avoid summation loops for /proc/stat
  bcache: improve sysfs_strtoul_clamp()
  bcache: fix input overflow to sequential_cutoff
  bcache: fix input overflow to cache set sysfs file io_error_halflife
  sched/topology: Fix percpu data types in struct sd_data & struct s_data
  usb: f_fs: Avoid crash due to out-of-scope stack ptr access
  ALSA: PCM: check if ops are defined before suspending PCM
  ARM: 8833/1: Ensure that NEON code always compiles with Clang
  netfilter: conntrack: fix cloned unconfirmed skb->_nfct race in __nf_conntrack_confirm
  kprobes: Prohibit probing on bsearch()
  ACPI / video: Refactor and fix dmi_is_desktop()
  iwlwifi: pcie: fix emergency path
  leds: lp55xx: fix null deref on firmware load failure
  jbd2: fix race when writing superblock
  HID: intel-ish-hid: avoid binding wrong ishtp_cl_device
  vfs: fix preadv64v2 and pwritev64v2 compat syscalls with offset == -1
  media: mtk-jpeg: Correct return type for mem2mem buffer helpers
  media: mx2_emmaprp: Correct return type for mem2mem buffer helpers
  media: s5p-g2d: Correct return type for mem2mem buffer helpers
  media: s5p-jpeg: Correct return type for mem2mem buffer helpers
  media: sh_veu: Correct return type for mem2mem buffer helpers
  SoC: imx-sgtl5000: add missing put_device()
  perf test: Fix failure of 'evsel-tp-sched' test on s390
  scsi: fcoe: make use of fip_mode enum complete
  scsi: megaraid_sas: return error when create DMA pool failed
  efi: cper: Fix possible out-of-bounds access
  cpufreq: acpi-cpufreq: Report if CPU doesn't support boost technologies
  clk: fractional-divider: check parent rate only if flag is set
  IB/mlx4: Increase the timeout for CM cache
  mlxsw: spectrum: Avoid -Wformat-truncation warnings
  e1000e: Fix -Wformat-truncation warnings
  mmc: omap: fix the maximum timeout setting
  powerpc/hugetlb: Handle mmap_min_addr correctly in get_unmapped_area callback
  iommu/io-pgtable-arm-v7s: Only kmemleak_ignore L2 tables
  ARM: 8840/1: use a raw_spinlock_t in unwind
  serial: 8250_pxa: honor the port number from devicetree
  coresight: etm4x: Add support to enable ETMv4.2
  powerpc/xmon: Fix opcode being uninitialized in print_insn_powerpc
  scsi: core: replace GFP_ATOMIC with GFP_KERNEL in scsi_scan.c
  usb: chipidea: Grab the (legacy) USB PHY by phandle first
  crypto: cavium/zip - fix collision with generic cra_driver_name
  crypto: crypto4xx - add missing of_node_put after of_device_is_available
  wil6210: check null pointer in _wil_cfg80211_merge_extra_ies
  PCI/PME: Fix hotplug/sysfs remove deadlock in pcie_pme_remove()
  tools lib traceevent: Fix buffer overflow in arg_eval
  fs: fix guard_bio_eod to check for real EOD errors
  jbd2: fix invalid descriptor block checksum
  cifs: Fix NULL pointer dereference of devname
  dm thin: add sanity checks to thin-pool and external snapshot creation
  cifs: use correct format characters
  page_poison: play nicely with KASAN
  fs/file.c: initialize init_files.resize_wait
  f2fs: do not use mutex lock in atomic context
  ocfs2: fix a panic problem caused by o2cb_ctl
  mm/slab.c: kmemleak no scan alien caches
  mm/vmalloc.c: fix kernel BUG at mm/vmalloc.c:512!
  mm, mempolicy: fix uninit memory access
  mm/page_ext.c: fix an imbalance with kmemleak
  mm/cma.c: cma_declare_contiguous: correct err handling
  perf c2c: Fix c2c report for empty numa node
  iio: adc: fix warning in Qualcomm PM8xxx HK/XOADC driver
  scsi: hisi_sas: Set PHY linkrate when disconnected
  enic: fix build warning without CONFIG_CPUMASK_OFFSTACK
  sysctl: handle overflow for file-max
  include/linux/relay.h: fix percpu annotation in struct rchan
  gpio: gpio-omap: fix level interrupt idling
  net/mlx5: Avoid panic when setting vport mac, getting vport config
  net/mlx5: Avoid panic when setting vport rate
  tracing: kdb: Fix ftdump to not sleep
  f2fs: fix to avoid deadlock in f2fs_read_inline_dir()
  h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux-
  CIFS: fix POSIX lock leak and invalid ptr deref
  mm: mempolicy: make mbind() return -EIO when MPOL_MF_STRICT is specified
  tty/serial: atmel: RS485 HD w/DMA: enable RX after TX is stopped
  tty/serial: atmel: Add is_half_duplex helper
  lib/int_sqrt: optimize initial value compute
  ext4: cleanup bh release code in ext4_ind_remove_space()
  arm64: debug: Don't propagate UNKNOWN FAR into si_code for debug signals
  ANDROID: cuttlefish_defconfig: Enable CONFIG_OVERLAY_FS
  ANDROID: cuttlefish: enable CONFIG_NET_SCH_INGRESS=y

Conflicts:
	drivers/usb/gadget/function/f_fs.c
	mm/page_alloc.c
	net/netfilter/nf_conntrack_core.c

Change-Id: I4a3db0717eb4f0f0d89e57f3167129bcd2419599
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2019-05-15 08:16:13 -07:00
Blagovest Kolenichev
b36940959e Merge android-4.14.106 (8ed9bc6) into msm-4.14
* refs/heads/tmp-8ed9bc6:
  Revert "staging: android: ion: fix sys heap pool's gfp_flags"
  Linux 4.14.106
  perf/x86/intel: Implement support for TSX Force Abort
  x86: Add TSX Force Abort CPUID/MSR
  perf/x86/intel: Generalize dynamic constraint creation
  perf/x86/intel: Make cpuc allocations consistent
  driver core: Postpone DMA tear-down until after devres release
  ath9k: Avoid OF no-EEPROM quirks without qca,no-eeprom
  gfs2: Fix missed wakeups in find_insert_glock
  ARM: 8781/1: Fix Thumb-2 syscall return for binutils 2.29+
  drm: disable uncached DMA optimization for ARM and arm64
  ARM: dts: exynos: Add minimal clkout parameters to Exynos3250 PMU
  ARM: dts: exynos: Fix pinctrl definition for eMMC RTSN line on Odroid X2/U3
  arm64: dts: hikey: Give wifi some time after power-on
  scsi: aacraid: Fix missing break in switch statement
  iscsi_ibft: Fix missing break in switch statement
  Input: elan_i2c - add id for touchpad found in Lenovo s21e-20
  Input: wacom_serial4 - add support for Wacom ArtPad II tablet
  qed: Consider TX tcs while deriving the max num_queues for PF.
  qed: Fix EQ full firmware assert.
  fs: ratelimit __find_get_block_slow() failure message.
  i2c: omap: Use noirq system sleep pm ops to idle device for suspend
  MIPS: Remove function size check in get_frame_info()
  perf trace: Support multiple "vfs_getname" probes
  perf symbols: Filter out hidden symbols from labels
  s390/qeth: fix use-after-free in error path
  netfilter: nf_nat: skip nat clash resolution for same-origin entries
  selftests: netfilter: add simple masq/redirect test cases
  selftests: netfilter: fix config fragment CONFIG_NF_TABLES_INET
  dmaengine: dmatest: Abort test in case of mapping error
  vsock/virtio: reset connected sockets on device removal
  vsock/virtio: fix kernel panic after device hot-unplug
  dmaengine: at_xdmac: Fix wrongfull report of a channel as in use
  drm/sun4i: tcon: Prepare and enable TCON channel 0 clock at init
  bpf: fix lockdep false positive in percpu_freelist
  bpf, selftests: fix handling of sparse CPU allocations
  relay: check return of create_buf_file() properly
  irqchip/gic-v3-its: Fix ITT_entry_size accessor
  net: stmmac: Disable EEE mode earlier in XMIT callback
  net: stmmac: Send TSO packets always from Queue 0
  net: stmmac: Fallback to Platform Data clock in Watchdog conversion
  irqchip/mmp: Only touch the PJ4 IRQ & FIQ bits on enable/disable
  usb: phy: fix link errors
  DTS: CI20: Fix bugs in ci20's device tree.
  arm64: dts: add msm8996 compatible to gicv3
  ARM: pxa: ssp: unneeded to free devm_ allocated data
  bpf: sock recvbuff must be limited by rmem_max in bpf_setsockopt()
  soc: fsl: qbman: avoid race in clearing QMan interrupt
  arm64: dts: renesas: r8a7796: Enable DMA for SCIF2
  ARM: dts: omap4-droid4: Fix typo in cpcap IRQ flags
  autofs: fix error return in autofs_fill_super()
  autofs: drop dentry reference only when it is never used
  fs/drop_caches.c: avoid softlockups in drop_pagecache_sb()
  lib/test_kmod.c: potential double free in error handling
  mm, memory_hotplug: test_pages_in_a_zone do not pass the end of zone
  mm, memory_hotplug: is_mem_section_removable do not pass the end of a zone
  x86_64: increase stack size for KASAN_EXTRA
  x86/kexec: Don't setup EFI info if EFI runtime is not enabled
  apparmor: Fix aa_label_build() error handling for failed merges
  arm64: kprobe: Always blacklist the KVM world-switch code
  x86/microcode/amd: Don't falsely trick the late loading mechanism
  cifs: fix computation for MAX_SMB2_HDR_SIZE
  platform/x86: Fix unmet dependency warning for SAMSUNG_Q10
  scsi: 53c700: pass correct "dev" to dma_alloc_attrs()
  scsi: libfc: free skb when receiving invalid flogi resp
  qed: Fix stack out of bounds bug
  qed: Fix system crash in ll2 xmit
  qed: Fix VF probe failure while FLR
  qed: Fix LACP pdu drops for VFs
  qed: Fix bug in tx promiscuous mode settings
  nfs: Fix NULL pointer dereference of dev_name
  selftests: timers: use LDLIBS instead of LDFLAGS
  gpio: vf610: Mask all GPIO interrupts
  netfilter: ebtables: compat: un-break 32bit setsockopt when no rules are present
  net: stmmac: dwmac-rk: fix error handling in rk_gmac_powerup()
  net: hns: Fix wrong read accesses via Clause 45 MDIO protocol
  net: hns: Restart autoneg need return failed when autoneg off
  net: hns: Fix for missing of_node_put() after of_parse_phandle()
  net: altera_tse: fix msgdma_tx_completion on non-zero fill_level case
  xtensa: SMP: limit number of possible CPUs by NR_CPUS
  xtensa: SMP: mark each possible CPU as present
  xtensa: smp_lx200_defconfig: fix vectors clash
  xtensa: SMP: fix secondary CPU initialization
  selftests: cpu-hotplug: fix case where CPUs offline > CPUs present
  xtensa: SMP: fix ccount_timer_shutdown
  iommu/amd: Fix IOMMU page flush when detach device from a domain
  ipvs: Fix signed integer overflow when setsockopt timeout
  iommu/amd: Unmap all mapped pages in error path of map_sg
  iommu/amd: Call free_iova_fast with pfn in map_sg
  IB/{hfi1, qib}: Fix WC.byte_len calculation for UD_SEND_WITH_IMM
  perf tools: Handle TOPOLOGY headers with no CPU
  perf core: Fix perf_proc_update_handler() bug
  vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel
  media: uvcvideo: Fix 'type' check leading to overflow
  scsi: core: reset host byte in DID_NEXUS_FAILURE case
  exec: Fix mem leak in kernel_read_file
  Bluetooth: Fix locking in bt_accept_enqueue() for BH context
  xtensa: fix get_wchan
  hugetlbfs: fix races and page leaks during migration
  MIPS: irq: Allocate accurate order pages for irq stack
  applicom: Fix potential Spectre v1 vulnerabilities
  x86/CPU/AMD: Set the CPB bit unconditionally on F17h
  net: dsa: mv88e6xxx: Fix statistics on mv88e6161
  net: phy: Micrel KSZ8061: link failure after cable connect
  tun: remove unnecessary memory barrier
  tun: fix blocking read
  mpls: Return error for RTA_GATEWAY attribute
  ipv6: Return error for RTA_VIA attribute
  ipv4: Return error for RTA_VIA attribute
  net: avoid use IPCB in cipso_v4_error
  net: Add __icmp_send helper.
  xen-netback: fix occasional leak of grant ref mappings under memory pressure
  xen-netback: don't populate the hash cache on XenBus disconnect
  net: socket: set sock->sk to NULL after calling proto_ops::release()
  net: sit: fix memory leak in sit_init_net()
  net: phy: phylink: fix uninitialized variable in phylink_get_mac_state
  net: nfc: Fix NULL dereference on nfc_llcp_build_tlv fails
  net: netem: fix skb length BUG_ON in __skb_to_sgvec
  netlabel: fix out-of-bounds memory accesses
  net: dsa: mv88e6xxx: Fix u64 statistics
  hv_netvsc: Fix IP header checksum for coalesced packets
  geneve: correctly handle ipv6.disable module parameter
  bnxt_en: Drop oversize TX packets to prevent errors.
  tipc: fix RDM/DGRAM connect() regression
  team: Free BPF filter when unregistering netdev
  sky2: Disable MSI on Dell Inspiron 1545 and Gateway P-79
  net-sysfs: Fix mem leak in netdev_register_kobject
  net: dsa: mv88e6xxx: handle unknown duplex modes gracefully in mv88e6xxx_port_set_duplex
  ip6mr: Do not call __IP6_INC_STATS() from preemptible context
  staging: android: ion: fix sys heap pool's gfp_flags
  staging: wilc1000: fix to set correct value for 'vif_num'
  staging: comedi: ni_660x: fix missing break in switch statement
  USB: serial: ftdi_sio: add ID for Hjelmslund Electronics USB485
  USB: serial: cp210x: add ID for Ingenico 3070
  USB: serial: option: add Telit ME910 ECM composition
  cpufreq: Use struct kobj_attribute instead of struct global_attr
  ANDROID: cuttlefish: enable CONFIG_INET_UDP_DIAG=y
  ANDROID: cuttlefish: enable CONFIG_USB_RTL8152=y

Change-Id: Id5bc9a3c0ca235fcf07904455ea829c7f49618ad
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2019-04-22 06:27:20 -07:00
Carlos Maiolino
c263daec8b fs: fix guard_bio_eod to check for real EOD errors
[ Upstream commit dce30ca9e3b676fb288c33c1f4725a0621361185 ]

guard_bio_eod() can truncate a segment in bio to allow it to do IO on
odd last sectors of a device.

It already checks if the IO starts past EOD, but it does not consider
the possibility of an IO request starting within device boundaries can
contain more than one segment past EOD.

In such cases, truncated_bytes can be bigger than PAGE_SIZE, and will
underflow bvec->bv_len.

Fix this by checking if truncated_bytes is lower than PAGE_SIZE.

This situation has been found on filesystems such as isofs and vfat,
which doesn't check the device size before mount, if the device is
smaller than the filesystem itself, a readahead on such filesystem,
which spans EOD, can trigger this situation, leading a call to
zero_user() with a wrong size possibly corrupting memory.

I didn't see any crash, or didn't let the system run long enough to
check if memory corruption will be hit somewhere, but adding
instrumentation to guard_bio_end() to check truncated_bytes size, was
enough to see the error.

The following script can trigger the error.

MNT=/mnt
IMG=./DISK.img
DEV=/dev/loop0

mkfs.vfat $IMG
mount $IMG $MNT
cp -R /etc $MNT &> /dev/null
umount $MNT

losetup -D

losetup --find --show --sizelimit 16247280 $IMG
mount $DEV $MNT

find $MNT -type f -exec cat {} + >/dev/null

Kudos to Eric Sandeen for coming up with the reproducer above

Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-05 22:31:28 +02:00
Tetsuo Handa
ef1c919ec6 fs: ratelimit __find_get_block_slow() failure message.
[ Upstream commit 43636c804df0126da669c261fc820fb22f62bfc2 ]

When something let __find_get_block_slow() hit all_mapped path, it calls
printk() for 100+ times per a second. But there is no need to print same
message with such high frequency; it is just asking for stall warning, or
at least bloating log files.

  [  399.866302][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8
  [  399.873324][T15342] b_state=0x00000029, b_size=512
  [  399.878403][T15342] device loop0 blocksize: 4096
  [  399.883296][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8
  [  399.890400][T15342] b_state=0x00000029, b_size=512
  [  399.895595][T15342] device loop0 blocksize: 4096
  [  399.900556][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8
  [  399.907471][T15342] b_state=0x00000029, b_size=512
  [  399.912506][T15342] device loop0 blocksize: 4096

This patch reduces frequency to up to once per a second, in addition to
concatenating three lines into one.

  [  399.866302][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8, b_state=0x00000029, b_size=512, device loop0 blocksize: 4096

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-03-13 14:03:22 -07:00
Laura Abbott
aa9442760f fs/buffer.c: Revoke LRU when trying to drop buffers
When a buffer is added to the LRU list, a reference is taken which is
not dropped until the buffer is evicted from the LRU list. This is the
correct behavior, however this LRU reference will prevent the buffer
from being dropped. This means that the buffer can't actually be dropped
until it is selected for eviction. There's no bound on the time spent
on the LRU list, which means that the buffer may be undroppable for
very long periods of time. Given that migration involves dropping
buffers, the associated page is now unmigratible for long periods of
time as well. CMA relies on being able to migrate a specific range
of pages, so these these types of failures make CMA significantly
less reliable, especially under high filesystem usage.

Rather than waiting for the LRU algorithm to eventually kick out
the buffer, explicitly remove the buffer from the LRU list when trying
to drop it. There is still the possibility that the buffer
could be added back on the list, but that indicates the buffer is
still in use and would probably have other 'in use' indicates to
prevent dropping.

Change-Id: I253f4ee2069e190c1115afc421dadd27a7fa87dc
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2018-05-21 17:10:28 +05:30
Jaegeuk Kim
9d468a2b52 Revert "locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE()"
Change fscrypt only.

This reverts commit 4bb665c7e3.
2018-01-09 17:01:36 -08:00
Mark Rutland
4bb665c7e3 locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE()
Please do not apply this to mainline directly, instead please re-run the
coccinelle script shown below and apply its output.

For several reasons, it is desirable to use {READ,WRITE}_ONCE() in
preference to ACCESS_ONCE(), and new code is expected to use one of the
former. So far, there's been no reason to change most existing uses of
ACCESS_ONCE(), as these aren't harmful, and changing them results in
churn.

However, for some features, the read/write distinction is critical to
correct operation. To distinguish these cases, separate read/write
accessors must be used. This patch migrates (most) remaining
ACCESS_ONCE() instances to {READ,WRITE}_ONCE(), using the following
coccinelle script:

----
// Convert trivial ACCESS_ONCE() uses to equivalent READ_ONCE() and
// WRITE_ONCE()

// $ make coccicheck COCCI=/home/mark/once.cocci SPFLAGS="--include-headers" MODE=patch

virtual patch

@ depends on patch @
expression E1, E2;
@@

- ACCESS_ONCE(E1) = E2
+ WRITE_ONCE(E1, E2)

@ depends on patch @
expression E;
@@

- ACCESS_ONCE(E)
+ READ_ONCE(E)
----

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: davem@davemloft.net
Cc: linux-arch@vger.kernel.org
Cc: mpe@ellerman.id.au
Cc: shuah@kernel.org
Cc: snitzer@redhat.com
Cc: thor.thayer@linux.intel.com
Cc: tj@kernel.org
Cc: viro@zeniv.linux.org.uk
Cc: will.deacon@arm.com
Link: http://lkml.kernel.org/r/1508792849-3115-19-git-send-email-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-01-04 18:14:32 -08:00
Greg Edwards
5c21c3dde4 fs: guard_bio_eod() needs to consider partitions
commit 67f2519fe2903c4041c0e94394d14d372fe51399 upstream.

guard_bio_eod() needs to look at the partition capacity, not just the
capacity of the whole device, when determining if truncation is
necessary.

[   60.268688] attempt to access beyond end of device
[   60.268690] unknown-block(9,1): rw=0, want=67103509, limit=67103506
[   60.268693] buffer_io_error: 2 callbacks suppressed
[   60.268696] Buffer I/O error on dev md1p7, logical block 4524305, async page read

Fixes: 74d46992e0 ("block: replace bi_bdev with a gendisk pointer and partitions index")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Edwards <gedwards@ddn.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:40:45 +00:00
Linus Torvalds
a0725ab0c7 Merge branch 'for-4.14/block' of git://git.kernel.dk/linux-block
Pull block layer updates from Jens Axboe:
 "This is the first pull request for 4.14, containing most of the code
  changes. It's a quiet series this round, which I think we needed after
  the churn of the last few series. This contains:

   - Fix for a registration race in loop, from Anton Volkov.

   - Overflow complaint fix from Arnd for DAC960.

   - Series of drbd changes from the usual suspects.

   - Conversion of the stec/skd driver to blk-mq. From Bart.

   - A few BFQ improvements/fixes from Paolo.

   - CFQ improvement from Ritesh, allowing idling for group idle.

   - A few fixes found by Dan's smatch, courtesy of Dan.

   - A warning fixup for a race between changing the IO scheduler and
     device remova. From David Jeffery.

   - A few nbd fixes from Josef.

   - Support for cgroup info in blktrace, from Shaohua.

   - Also from Shaohua, new features in the null_blk driver to allow it
     to actually hold data, among other things.

   - Various corner cases and error handling fixes from Weiping Zhang.

   - Improvements to the IO stats tracking for blk-mq from me. Can
     drastically improve performance for fast devices and/or big
     machines.

   - Series from Christoph removing bi_bdev as being needed for IO
     submission, in preparation for nvme multipathing code.

   - Series from Bart, including various cleanups and fixes for switch
     fall through case complaints"

* 'for-4.14/block' of git://git.kernel.dk/linux-block: (162 commits)
  kernfs: checking for IS_ERR() instead of NULL
  drbd: remove BIOSET_NEED_RESCUER flag from drbd_{md_,}io_bio_set
  drbd: Fix allyesconfig build, fix recent commit
  drbd: switch from kmalloc() to kmalloc_array()
  drbd: abort drbd_start_resync if there is no connection
  drbd: move global variables to drbd namespace and make some static
  drbd: rename "usermode_helper" to "drbd_usermode_helper"
  drbd: fix race between handshake and admin disconnect/down
  drbd: fix potential deadlock when trying to detach during handshake
  drbd: A single dot should be put into a sequence.
  drbd: fix rmmod cleanup, remove _all_ debugfs entries
  drbd: Use setup_timer() instead of init_timer() to simplify the code.
  drbd: fix potential get_ldev/put_ldev refcount imbalance during attach
  drbd: new disk-option disable-write-same
  drbd: Fix resource role for newly created resources in events2
  drbd: mark symbols static where possible
  drbd: Send P_NEG_ACK upon write error in protocol != C
  drbd: add explicit plugging when submitting batches
  drbd: change list_for_each_safe to while(list_first_entry_or_null)
  drbd: introduce drbd_recv_header_maybe_unplug
  ...
2017-09-07 11:59:42 -07:00
Jan Kara
397162ffa2 mm: remove nr_pages argument from pagevec_lookup{,_range}()
All users of pagevec_lookup() and pagevec_lookup_range() now pass
PAGEVEC_SIZE as a desired number of pages.

Just drop the argument.

Link: http://lkml.kernel.org/r/20170726114704.7626-11-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-09-06 17:27:27 -07:00
Jan Kara
8338141f0f fs: use pagevec_lookup_range() in page_cache_seek_hole_data()
We want only pages from given range in page_cache_seek_hole_data().  Use
pagevec_lookup_range() instead of pagevec_lookup() and remove
unnecessary code.

Note that the check for getting less pages than desired can be removed
because index gets updated by pagevec_lookup_range().

Link: http://lkml.kernel.org/r/20170726114704.7626-9-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-09-06 17:27:27 -07:00
Jan Kara
c10f778ddf fs: fix performance regression in clean_bdev_aliases()
Commit e64855c6cf ("fs: Add helper to clean bdev aliases under a bh
and use it") added a wrapper for clean_bdev_aliases() that invalidates
bdev aliases underlying a single buffer head.

However this has caused a performance regression for bonnie++ benchmark
on ext4 filesystem when delayed allocation is turned off (ext3 mode) -
average of 3 runs:

  Hmean SeqOut Char  164787.55 (  0.00%) 107189.06 (-34.95%)
  Hmean SeqOut Block 219883.89 (  0.00%) 168870.32 (-23.20%)

The reason for this regression is that clean_bdev_aliases() is slower
when called for a single block because pagevec_lookup() it uses will end
up iterating through the radix tree until it finds a page (which may
take a while) but we are only interested whether there's a page at a
particular index.

Fix the problem by using pagevec_lookup_range() instead which avoids the
needless iteration.

Fixes: e64855c6cf ("fs: Add helper to clean bdev aliases under a bh and use it")
Link: http://lkml.kernel.org/r/20170726114704.7626-5-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-09-06 17:27:26 -07:00
Jan Kara
d72dc8a25a mm: make pagevec_lookup() update index
Make pagevec_lookup() (and underlying find_get_pages()) update index to
the next page where iteration should continue.  Most callers want this
and also pagevec_lookup_tag() already does this.

Link: http://lkml.kernel.org/r/20170726114704.7626-3-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-09-06 17:27:26 -07:00
Christoph Hellwig
74d46992e0 block: replace bi_bdev with a gendisk pointer and partitions index
This way we don't need a block_device structure to submit I/O.  The
block_device has different life time rules from the gendisk and
request_queue and is usually only available when the block device node
is open.  Other callers need to explicitly create one (e.g. the lightnvm
passthrough code, or the new nvme multipathing code).

For the actual I/O path all that we need is the gendisk, which exists
once per block device.  But given that the block layer also does
partition remapping we additionally need a partition index, which is
used for said remapping in generic_make_request.

Note that all the block drivers generally want request_queue or
sometimes the gendisk, so this removes a layer of indirection all
over the stack.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-08-23 12:49:55 -06:00
Eric Biggers
241f01fbed fs/buffer.c: make bh_lru_install() more efficient
To install a buffer_head into the cpu's LRU queue, bh_lru_install()
would construct a new copy of the queue and then memcpy it over the real
queue.  But it's easily possible to do the update in-place, which is
faster and simpler.  Some work can also be skipped if the buffer_head
was already in the queue.

As a microbenchmark I timed how long it takes to run sb_getblk()
10,000,000 times alternating between BH_LRU_SIZE + 1 blocks.
Effectively, this benchmarks looking up buffer_heads that are in the
page cache but not in the LRU:

	Before this patch: 1.758s
	After this patch: 1.653s

This patch also removes about 350 bytes of compiled code (on x86_64),
partly due to removal of the memcpy() which was being inlined+unrolled.

Link: http://lkml.kernel.org/r/20161229193445.1913-1-ebiggers3@gmail.com
Signed-off-by: Eric Biggers <ebiggers@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-10 16:32:30 -07:00
Linus Torvalds
642338ba33 Merge tag 'xfs-4.13-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull XFS updates from Darrick Wong:
 "Here are some changes for you for 4.13. For the most part it's fixes
  for bugs and deadlock problems, and preparation for online fsck in
  some future merge window.

   - Avoid quotacheck deadlocks

   - Fix transaction overflows when bunmapping fragmented files

   - Refactor directory readahead

   - Allow admin to configure if ASSERT is fatal

   - Improve transaction usage detail logging during overflows

   - Minor cleanups

   - Don't leak log items when the log shuts down

   - Remove double-underscore typedefs

   - Various preparation for online scrubbing

   - Introduce new error injection configuration sysfs knobs

   - Refactor dq_get_next to use extent map directly

   - Fix problems with iterating the page cache for unwritten data

   - Implement SEEK_{HOLE,DATA} via iomap

   - Refactor XFS to use iomap SEEK_HOLE and SEEK_DATA

   - Don't use MAXPATHLEN to check on-disk symlink target lengths"

* tag 'xfs-4.13-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (48 commits)
  xfs: don't crash on unexpected holes in dir/attr btrees
  xfs: rename MAXPATHLEN to XFS_SYMLINK_MAXLEN
  xfs: fix contiguous dquot chunk iteration livelock
  xfs: Switch to iomap for SEEK_HOLE / SEEK_DATA
  vfs: Add iomap_seek_hole and iomap_seek_data helpers
  vfs: Add page_cache_seek_hole_data helper
  xfs: remove a whitespace-only line from xfs_fs_get_nextdqblk
  xfs: rewrite xfs_dq_get_next_id using xfs_iext_lookup_extent
  xfs: Check for m_errortag initialization in xfs_errortag_test
  xfs: grab dquots without taking the ilock
  xfs: fix semicolon.cocci warnings
  xfs: Don't clear SGID when inheriting ACLs
  xfs: free cowblocks and retry on buffered write ENOSPC
  xfs: replace log_badcrc_factor knob with error injection tag
  xfs: convert drop_writes to use the errortag mechanism
  xfs: remove unneeded parameter from XFS_TEST_ERROR
  xfs: expose errortag knobs via sysfs
  xfs: make errortag a per-mountpoint structure
  xfs: free uncommitted transactions during log recovery
  xfs: don't allow bmap on rt files
  ...
2017-07-10 10:51:53 -07:00
Linus Torvalds
bc2c6421cb Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 updates from Ted Ts'o:
 "The first major feature for ext4 this merge window is the largedir
  feature, which allows ext4 directories to support over 2 billion
  directory entries (assuming ~64 byte file names; in practice, users
  will run into practical performance limits first.) This feature was
  originally written by the Lustre team, and credit goes to Artem
  Blagodarenko from Seagate for getting this feature upstream.

  The second major major feature allows ext4 to support extended
  attribute values up to 64k. This feature was also originally from
  Lustre, and has been enhanced by Tahsin Erdogan from Google with a
  deduplication feature so that if multiple files have the same xattr
  value (for example, Windows ACL's stored by Samba), only one copy will
  be stored on disk for encoding and caching efficiency.

  We also have the usual set of bug fixes, cleanups, and optimizations"

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (47 commits)
  ext4: fix spelling mistake: "prellocated" -> "preallocated"
  ext4: fix __ext4_new_inode() journal credits calculation
  ext4: skip ext4_init_security() and encryption on ea_inodes
  fs: generic_block_bmap(): initialize all of the fields in the temp bh
  ext4: change fast symlink test to not rely on i_blocks
  ext4: require key for truncate(2) of encrypted file
  ext4: don't bother checking for encryption key in ->mmap()
  ext4: check return value of kstrtoull correctly in reserved_clusters_store
  ext4: fix off-by-one fsmap error on 1k block filesystems
  ext4: return EFSBADCRC if a bad checksum error is found in ext4_find_entry()
  ext4: return EIO on read error in ext4_find_entry
  ext4: forbid encrypting root directory
  ext4: send parallel discards on commit completions
  ext4: avoid unnecessary stalls in ext4_evict_inode()
  ext4: add nombcache mount option
  ext4: strong binding of xattr inode references
  ext4: eliminate xattr entry e_hash recalculation for removes
  ext4: reserve space for xattr entries/names
  quota: add get_inode_usage callback to transfer multi-inode charges
  ext4: xattr inode deduplication
  ...
2017-07-09 09:31:22 -07:00
Linus Torvalds
088737f44b Merge tag 'for-linus-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux
Pull Writeback error handling updates from Jeff Layton:
 "This pile represents the bulk of the writeback error handling fixes
  that I have for this cycle. Some of the earlier patches in this pile
  may look trivial but they are prerequisites for later patches in the
  series.

  The aim of this set is to improve how we track and report writeback
  errors to userland. Most applications that care about data integrity
  will periodically call fsync/fdatasync/msync to ensure that their
  writes have made it to the backing store.

  For a very long time, we have tracked writeback errors using two flags
  in the address_space: AS_EIO and AS_ENOSPC. Those flags are set when a
  writeback error occurs (via mapping_set_error) and are cleared as a
  side-effect of filemap_check_errors (as you noted yesterday). This
  model really sucks for userland.

  Only the first task to call fsync (or msync or fdatasync) will see the
  error. Any subsequent task calling fsync on a file will get back 0
  (unless another writeback error occurs in the interim). If I have
  several tasks writing to a file and calling fsync to ensure that their
  writes got stored, then I need to have them coordinate with one
  another. That's difficult enough, but in a world of containerized
  setups that coordination may even not be possible.

  But wait...it gets worse!

  The calls to filemap_check_errors can be buried pretty far down in the
  call stack, and there are internal callers of filemap_write_and_wait
  and the like that also end up clearing those errors. Many of those
  callers ignore the error return from that function or return it to
  userland at nonsensical times (e.g. truncate() or stat()). If I get
  back -EIO on a truncate, there is no reason to think that it was
  because some previous writeback failed, and a subsequent fsync() will
  (incorrectly) return 0.

  This pile aims to do three things:

   1) ensure that when a writeback error occurs that that error will be
      reported to userland on a subsequent fsync/fdatasync/msync call,
      regardless of what internal callers are doing

   2) report writeback errors on all file descriptions that were open at
      the time that the error occurred. This is a user-visible change,
      but I think most applications are written to assume this behavior
      anyway. Those that aren't are unlikely to be hurt by it.

   3) document what filesystems should do when there is a writeback
      error. Today, there is very little consistency between them, and a
      lot of cargo-cult copying. We need to make it very clear what
      filesystems should do in this situation.

  To achieve this, the set adds a new data type (errseq_t) and then
  builds new writeback error tracking infrastructure around that. Once
  all of that is in place, we change the filesystems to use the new
  infrastructure for reporting wb errors to userland.

  Note that this is just the initial foray into cleaning up this mess.
  There is a lot of work remaining here:

   1) convert the rest of the filesystems in a similar fashion. Once the
      initial set is in, then I think most other fs' will be fairly
      simple to convert. Hopefully most of those can in via individual
      filesystem trees.

   2) convert internal waiters on writeback to use errseq_t for
      detecting errors instead of relying on the AS_* flags. I have some
      draft patches for this for ext4, but they are not quite ready for
      prime time yet.

  This was a discussion topic this year at LSF/MM too. If you're
  interested in the gory details, LWN has some good articles about this:

      https://lwn.net/Articles/718734/
      https://lwn.net/Articles/724307/"

* tag 'for-linus-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
  btrfs: minimal conversion to errseq_t writeback error reporting on fsync
  xfs: minimal conversion to errseq_t writeback error reporting
  ext4: use errseq_t based error handling for reporting data writeback errors
  fs: convert __generic_file_fsync to use errseq_t based reporting
  block: convert to errseq_t based writeback error tracking
  dax: set errors in mapping when writeback fails
  Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors
  mm: set both AS_EIO/AS_ENOSPC and errseq_t in mapping_set_error
  fs: new infrastructure for writeback error handling and reporting
  lib: add errseq_t type and infrastructure for handling it
  mm: don't TestClearPageError in __filemap_fdatawait_range
  mm: clear AS_EIO/AS_ENOSPC when writeback initiation fails
  jbd2: don't clear and reset errors after waiting on writeback
  buffer: set errors in mapping at the time that the error occurs
  fs: check for writeback errors after syncing out buffers in generic_file_fsync
  buffer: use mapping_set_error instead of setting the flag
  mm: fix mapping_set_error call in me_pagecache_dirty
2017-07-07 19:38:17 -07:00
Jeff Layton
87354e5de0 buffer: set errors in mapping at the time that the error occurs
I noticed on xfs that I could still sometimes get back an error on fsync
on a fd that was opened after the error condition had been cleared.

The problem is that the buffer code sets the write_io_error flag and
then later checks that flag to set the error in the mapping. That flag
perisists for quite a while however. If the file is later opened with
O_TRUNC, the buffers will then be invalidated and the mapping's error
set such that a subsequent fsync will return error. I think this is
incorrect, as there was no writeback between the open and fsync.

Add a new mark_buffer_write_io_error operation that sets the flag and
the error in the mapping at the same time. Replace all calls to
set_buffer_write_io_error with mark_buffer_write_io_error, and remove
the places that check this flag in order to set the error in the
mapping.

This sets the error in the mapping earlier, at the time that it's first
detected.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
2017-07-06 07:02:21 -04:00
Jeff Layton
d945b59db8 buffer: use mapping_set_error instead of setting the flag
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2017-07-06 07:02:20 -04:00
Alexander Potapenko
2a527d6858 fs: generic_block_bmap(): initialize all of the fields in the temp bh
KMSAN (KernelMemorySanitizer, a new error detection tool) reports the
use of uninitialized memory in ext4_update_bh_state():

==================================================================
BUG: KMSAN: use of unitialized memory
CPU: 3 PID: 1 Comm: swapper/0 Tainted: G    B           4.8.0-rc6+ #597
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs
01/01/2011
 0000000000000282 ffff88003cc96f68 ffffffff81f30856 0000003000000008
 ffff88003cc96f78 0000000000000096 ffffffff8169742a ffff88003cc96ff8
 ffffffff812fc1fc 0000000000000008 ffff88003a1980e8 0000000100000000
Call Trace:
 [<     inline     >] __dump_stack lib/dump_stack.c:15
 [<ffffffff81f30856>] dump_stack+0xa6/0xc0 lib/dump_stack.c:51
 [<ffffffff812fc1fc>] kmsan_report+0x1ec/0x300 mm/kmsan/kmsan.c:?
 [<ffffffff812fc33b>] __msan_warning+0x2b/0x40 ??:?
 [<     inline     >] ext4_update_bh_state fs/ext4/inode.c:727
 [<ffffffff8169742a>] _ext4_get_block+0x6ca/0x8a0 fs/ext4/inode.c:759
 [<ffffffff81696d4c>] ext4_get_block+0x8c/0xa0 fs/ext4/inode.c:769
 [<ffffffff814a2d36>] generic_block_bmap+0x246/0x2b0 fs/buffer.c:2991
 [<ffffffff816ca30e>] ext4_bmap+0x5ee/0x660 fs/ext4/inode.c:3177
...
origin description: ----tmp@generic_block_bmap
==================================================================

(the line numbers are relative to 4.8-rc6, but the bug persists
upstream)

The local |tmp| is created in generic_block_bmap() and then passed into
ext4_bmap() => ext4_get_block() => _ext4_get_block() =>
ext4_update_bh_state(). Along the way tmp.b_page is never initialized
before ext4_update_bh_state() checks its value.

[ Use the approach suggested by Kees Cook of initializing the whole bh
  structure.]

Signed-off-by: Alexander Potapenko <glider@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-07-05 00:56:21 -04:00
Andreas Gruenbacher
334fd34d76 vfs: Add page_cache_seek_hole_data helper
Both ext4 and xfs implement seeking for the next hole or piece of data
in unwritten extents by scanning the page cache, and both versions share
the same bug when iterating the buffers of a page: the start offset into
the page isn't taken into account, so when a page fits more than two
filesystem blocks, things will go wrong.  For example, on a filesystem
with a block size of 1k, the following command will fail:

  xfs_io -f -c "falloc 0 4k" \
            -c "pwrite 1k 1k" \
            -c "pwrite 3k 1k" \
            -c "seek -a -r 0" foo

In this example, neither lseek(fd, 1024, SEEK_HOLE) nor lseek(fd, 2048,
SEEK_DATA) will return the correct result.

Introduce a generic vfs helper for seeking in the page cache that gets
this right.  The next commits will replace the filesystem specific
implementations.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
[hch: dropped the export]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2017-07-02 22:46:13 -07:00
Jens Axboe
8e8f929881 fs: add support for buffered writeback to pass down write hints
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-06-27 12:05:39 -06:00
Christoph Hellwig
4e4cbee93d block: switch bios to blk_status_t
Replace bi_error with a new bi_status to allow for a clear conversion.
Note that device mapper overloaded bi_error with a private value, which
we'll have to keep arround at least for now and thus propagate to a
proper blk_status_t value.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-06-09 09:27:32 -06:00
Linus Torvalds
11fbf53d66 Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc vfs updates from Al Viro:
 "Assorted bits and pieces from various people. No common topic in this
  pile, sorry"

* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  fs/affs: add rename exchange
  fs/affs: add rename2 to prepare multiple methods
  Make stat/lstat/fstatat pass AT_NO_AUTOMOUNT to vfs_statx()
  fs: don't set *REFERENCED on single use objects
  fs: compat: Remove warning from COMPATIBLE_IOCTL
  remove pointless extern of atime_need_update_rcu()
  fs: completely ignore unknown open flags
  fs: add a VALID_OPEN_FLAGS
  fs: remove _submit_bh()
  fs: constify tree_descr arrays passed to simple_fill_super()
  fs: drop duplicate header percpu-rwsem.h
  fs/affs: bugfix: Write files greater than page size on OFS
  fs/affs: bugfix: enable writes on OFS disks
  fs/affs: remove node generation check
  fs/affs: import amigaffs.h
  fs/affs: bugfix: make symbolic links work again
2017-05-09 09:12:53 -07:00
Tetsuo Handa
c718a97514 fs: semove set but not checked AOP_FLAG_UNINTERRUPTIBLE flag
Commit afddba49d1 ("fs: introduce write_begin, write_end, and
perform_write aops") introduced AOP_FLAG_UNINTERRUPTIBLE flag which was
checked in pagecache_write_begin(), but that check was removed by
4e02ed4b4a ("fs: remove prepare_write/commit_write").

Between these two commits, commit d9414774dc ("cifs: Convert cifs to
new aops.") added a check in cifs_write_begin(), but that check was soon
removed by commit a98ee8c1c7 ("[CIFS] fix regression in
cifs_write_begin/cifs_write_end").

Therefore, AOP_FLAG_UNINTERRUPTIBLE flag is checked nowhere.  Let's
remove this flag.  This patch has no functionality changes.

Link: http://lkml.kernel.org/r/1489294781-53494-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Nick Piggin <npiggin@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-05-08 17:15:14 -07:00
Eric Biggers
020c2833db fs: remove _submit_bh()
_submit_bh() allowed submitting a buffer_head for I/O using custom
bio_flags.  It used to be used by jbd to set BIO_SNAP_STABLE, introduced
by commit 7136851117 ("mm: make snapshotting pages for stable writes a
per-bio operation").  However, the code and flag has since been removed
and no _submit_bh() users remain.

These days, bio_flags are mostly used internally by the block layer to
track the state of bio's.  As such, it doesn't really make sense for
filesystems to use them instead of op_flags when wanting special
behavior for block requests.

Therefore, remove _submit_bh() and trim the bio_flags argument from
submit_bh_wbc().

Cc: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-04-26 23:54:06 -04:00
Ingo Molnar
f361bf4a66 sched/headers: Prepare for the reduction of <linux/sched.h>'s signal API dependency
Instead of including the full <linux/signal.h>, we are going to include the
types-only <linux/signal_types.h> header in <linux/sched.h>, to further
decouple the scheduler header from the signal headers.

This means that various files which relied on the full <linux/signal.h> need
to be updated to gain an explicit dependency on it.

Update the code that relies on sched.h's inclusion of the <linux/signal.h> header.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-03-02 08:42:37 +01:00
Fabian Frederick
93407472a2 fs: add i_blocksize()
Replace all 1 << inode->i_blkbits and (1 << inode->i_blkbits) in fs
branch.

This patch also fixes multiple checkpatch warnings: WARNING: Prefer
'unsigned int' to bare use of 'unsigned'

Thanks to Andrew Morton for suggesting more appropriate function instead
of macro.

[geliangtang@gmail.com: truncate: use i_blocksize()]
  Link: http://lkml.kernel.org/r/9c8b2cd83c8f5653805d43debde9fa8817e02fc4.1484895804.git.geliangtang@gmail.com
Link: http://lkml.kernel.org/r/1481319905-10126-1-git-send-email-fabf@skynet.be
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27 18:43:46 -08:00