]> Git Repo - J-linux.git/commitdiff
Merge tag 'f2fs-for-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeu...
authorLinus Torvalds <[email protected]>
Thu, 17 Dec 2020 19:18:00 +0000 (11:18 -0800)
committerLinus Torvalds <[email protected]>
Thu, 17 Dec 2020 19:18:00 +0000 (11:18 -0800)
Pull f2fs updates from Jaegeuk Kim:
 "In this round, we've made more work into per-file compression support.

  For example, F2FS_IOC_GET | SET_COMPRESS_OPTION provides a way to
  change the algorithm or cluster size per file. F2FS_IOC_COMPRESS |
  DECOMPRESS_FILE provides a way to compress and decompress the existing
  normal files manually.

  There is also a new mount option, compress_mode=fs|user, which can
  control who compresses the data.

  Chao also added a checksum feature with a mount option so that
  we are able to detect any corrupted cluster.

  In addition, Daniel contributed casefolding with encryption patch,
  which will be used for Android devices.

  Summary:

  Enhancements:
   - add ioctls and mount option to manage per-file compression feature
   - support casefolding with encryption
   - support checksum for compressed cluster
   - avoid IO starvation by replacing mutex with rwsem
   - add sysfs, max_io_bytes, to control max bio size

  Bug fixes:
   - fix use-after-free issue when compression and fsverity are enabled
   - fix consistency corruption during fault injection test
   - fix data offset for lseek
   - get rid of buffer_head which has 32bits limit in fiemap
   - fix some bugs in multi-partitions support
   - fix nat entry count calculation in shrinker
   - fix some stat information

  And, we've refactored some logics and fix minor bugs as well"

* tag 'f2fs-for-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (36 commits)
  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
  ...

18 files changed:
1  2 
MAINTAINERS
fs/crypto/fname.c
fs/crypto/fscrypt_private.h
fs/crypto/hooks.c
fs/ext4/dir.c
fs/ext4/ext4.h
fs/ext4/namei.c
fs/ext4/super.c
fs/f2fs/checkpoint.c
fs/f2fs/dir.c
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/super.c
fs/f2fs/sysfs.c
fs/libfs.c
fs/ubifs/dir.c
include/linux/fs.h
include/linux/fscrypt.h

diff --combined MAINTAINERS
index f59ebd1eda3de212913e4364da13d03bae8d67e5,13d8fbd74d728d1cef90f8f293665000aa0a49c8..b35b04abd08d703d8fd8cf523d537e9afefa2549
@@@ -929,18 -929,12 +929,18 @@@ L:      [email protected]
  S:    Maintained
  F:    drivers/i2c/busses/i2c-amd-mp2*
  
 +AMD PMC DRIVER
 +M:    Shyam Sundar S K <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/platform/x86/amd-pmc.*
 +
  AMD POWERPLAY
  M:    Evan Quan <[email protected]>
  L:    [email protected]
  S:    Supported
  T:    git git://people.freedesktop.org/~agd5f/linux
 -F:    drivers/gpu/drm/amd/powerplay/
 +F:    drivers/gpu/drm/amd/pm/powerplay/
  
  AMD SEATTLE DEVICE TREE SUPPORT
  M:    Brijesh Singh <[email protected]>
@@@ -956,14 -950,6 +956,14 @@@ S:       Supporte
  F:    arch/arm64/boot/dts/amd/amd-seattle-xgbe*.dtsi
  F:    drivers/net/ethernet/amd/xgbe/
  
 +AMD SENSOR FUSION HUB DRIVER
 +M:    Nehal Shah <[email protected]>
 +M:    Sandeep Singh <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/hid/amd-sfh*
 +F:    drivers/hid/amd-sfh-hid/
 +
  AMS AS73211 DRIVER
  M:    Christian Eggers <[email protected]>
  L:    [email protected]
@@@ -992,7 -978,7 +992,7 @@@ M: Michael Hennerich <Michael.Hennerich
  L:    [email protected]
  S:    Supported
  W:    http://ez.analog.com/community/linux-device-drivers
 -F:    Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.txt
 +F:    Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml
  F:    drivers/iio/adc/ad7768-1.c
  
  ANALOG DEVICES INC AD7780 DRIVER
@@@ -1087,7 -1073,6 +1087,7 @@@ M:      Hans Verkuil <hverkuil-cisco@xs4all.
  L:    [email protected]
  S:    Maintained
  F:    drivers/media/i2c/adv7604*
 +F:    Documentation/devicetree/bindings/media/i2c/adv7604.yaml
  
  ANALOG DEVICES INC ADV7842 DRIVER
  M:    Hans Verkuil <[email protected]>
@@@ -1188,6 -1173,16 +1188,6 @@@ S:     Supporte
  F:    Documentation/devicetree/bindings/rtc/google,goldfish-rtc.txt
  F:    drivers/rtc/rtc-goldfish.c
  
 -ANDROID ION DRIVER
 -M:    Laura Abbott <[email protected]>
 -M:    Sumit Semwal <[email protected]>
 -L:    [email protected]
 -L:    [email protected]
 -L:    [email protected] (moderated for non-subscribers)
 -S:    Supported
 -F:    drivers/staging/android/ion
 -F:    drivers/staging/android/uapi/ion.h
 -
  AOA (Apple Onboard Audio) ALSA DRIVER
  M:    Johannes Berg <[email protected]>
  L:    [email protected]
@@@ -1284,7 -1279,7 +1284,7 @@@ M:      Igor Russkikh <[email protected]
  L:    [email protected]
  S:    Supported
  W:    https://www.marvell.com/
 -Q:    http://patchwork.ozlabs.org/project/netdev/list/
 +Q:    https://patchwork.kernel.org/project/netdevbpf/list/
  F:    Documentation/networking/device_drivers/ethernet/aquantia/atlantic.rst
  F:    drivers/net/ethernet/aquantia/atlantic/
  
@@@ -1491,20 -1486,10 +1491,20 @@@ F:   Documentation/devicetree/bindings/io
  F:    drivers/iommu/arm/
  F:    drivers/iommu/io-pgtable-arm*
  
 +ARM AND ARM64 SoC SUB-ARCHITECTURES (COMMON PARTS)
 +M:    Arnd Bergmann <[email protected]>
 +M:    Olof Johansson <[email protected]>
 +M:    [email protected]
 +L:    [email protected] (moderated for non-subscribers)
 +S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git
 +F:    arch/arm/boot/dts/Makefile
 +F:    arch/arm64/boot/dts/Makefile
 +
  ARM SUB-ARCHITECTURES
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git
  F:    arch/arm/mach-*/
  F:    arch/arm/plat-*/
  
@@@ -1516,7 -1501,7 +1516,7 @@@ S:      Maintaine
  F:    Documentation/devicetree/bindings/arm/actions.yaml
  F:    Documentation/devicetree/bindings/clock/actions,owl-cmu.txt
  F:    Documentation/devicetree/bindings/dma/owl-dma.yaml
 -F:    Documentation/devicetree/bindings/i2c/i2c-owl.txt
 +F:    Documentation/devicetree/bindings/i2c/i2c-owl.yaml
  F:    Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.yaml
  F:    Documentation/devicetree/bindings/mmc/owl-mmc.yaml
  F:    Documentation/devicetree/bindings/pinctrl/actions,*
@@@ -1561,7 -1546,6 +1561,7 @@@ F:      drivers/clk/sunxi
  ARM/Allwinner sunXi SoC support
  M:    Maxime Ripard <[email protected]>
  M:    Chen-Yu Tsai <[email protected]>
 +R:    Jernej Skrabec <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git
@@@ -1739,13 -1723,11 +1739,13 @@@ F:   arch/arm/mach-ep93xx/micro9.
  
  ARM/CORESIGHT FRAMEWORK AND DRIVERS
  M:    Mathieu Poirier <[email protected]>
 -R:    Suzuki K Poulose <[email protected]>
 +M:    Suzuki K Poulose <[email protected]>
  R:    Mike Leach <[email protected]>
 +R:    Leo Yan <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux.git
  F:    Documentation/ABI/testing/sysfs-bus-coresight-devices-*
  F:    Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt
  F:    Documentation/devicetree/bindings/arm/coresight-cti.yaml
@@@ -1807,6 -1789,14 +1807,6 @@@ F:     drivers/firmware/turris-mox-rwtm.
  F:    drivers/gpio/gpio-moxtet.c
  F:    include/linux/moxtet.h
  
 -ARM/EBSA110 MACHINE SUPPORT
 -M:    Russell King <[email protected]>
 -L:    [email protected] (moderated for non-subscribers)
 -S:    Maintained
 -W:    http://www.armlinux.org.uk/
 -F:    arch/arm/mach-ebsa110/
 -F:    drivers/net/ethernet/amd/am79c961a.*
 -
  ARM/ENERGY MICRO (SILICON LABS) EFM32 SUPPORT
  M:    Uwe Kleine-König <[email protected]>
  R:    Pengutronix Kernel Team <[email protected]>
@@@ -2004,6 -1994,7 +2004,6 @@@ N:      lpc18x
  
  ARM/LPC32XX SOC SUPPORT
  M:    Vladimir Zapolskiy <[email protected]>
 -M:    Sylvain Lemieux <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  T:    git git://github.com/vzapolskiy/linux-lpc32xx.git
@@@ -2021,12 -2012,13 +2021,12 @@@ M:   Philipp Zabel <[email protected]
  S:    Maintained
  
  ARM/Marvell Dove/MV78xx0/Orion SOC support
 -M:    Jason Cooper <[email protected]>
  M:    Andrew Lunn <[email protected]>
  M:    Sebastian Hesselbarth <[email protected]>
  M:    Gregory Clement <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
 -T:    git git://git.infradead.org/linux-mvebu.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu.git
  F:    Documentation/devicetree/bindings/soc/dove/
  F:    arch/arm/boot/dts/dove*
  F:    arch/arm/boot/dts/orion5x*
@@@ -2037,12 -2029,13 +2037,12 @@@ F:   arch/arm/plat-orion
  F:    drivers/soc/dove/
  
  ARM/Marvell Kirkwood and Armada 370, 375, 38x, 39x, XP, 3700, 7K/8K, CN9130 SOC support
 -M:    Jason Cooper <[email protected]>
  M:    Andrew Lunn <[email protected]>
  M:    Gregory Clement <[email protected]>
  M:    Sebastian Hesselbarth <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
 -T:    git git://git.infradead.org/linux-mvebu.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu.git
  F:    arch/arm/boot/dts/armada*
  F:    arch/arm/boot/dts/kirkwood*
  F:    arch/arm/configs/mvebu_*_defconfig
@@@ -2074,7 -2067,7 +2074,7 @@@ M:      Matthias Brugger <matthias.bgg@gmail
  L:    [email protected] (moderated for non-subscribers)
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
 -W:    https://mtk.bcnfs.org/
 +W:    https://mtk.wiki.kernel.org/
  C:    irc://chat.freenode.net/linux-mediatek
  F:    arch/arm/boot/dts/mt6*
  F:    arch/arm/boot/dts/mt7*
  S:    Supported
  T:    git git://github.com/microchip-ung/linux-upstream.git
  F:    arch/arm64/boot/dts/microchip/
 +F:    drivers/pinctrl/pinctrl-microchip-sgpio.c
  N:    sparx5
  
 +Microchip Timer Counter Block (TCB) Capture Driver
 +M:    Kamel Bouhara <[email protected]>
 +L:    [email protected] (moderated for non-subscribers)
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/counter/microchip-tcb-capture.c
 +
  ARM/MIOA701 MACHINE SUPPORT
  M:    Robert Jarzmik <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
@@@ -2148,7 -2133,6 +2148,7 @@@ W:      http://linux-chenxing.org
  F:    Documentation/devicetree/bindings/arm/mstar/*
  F:    arch/arm/boot/dts/mstar-*
  F:    arch/arm/mach-mstar/
 +F:    include/dt-bindings/gpio/msc313-gpio.h
  
  ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT
  M:    Michael Petchkovsky <[email protected]>
@@@ -2390,7 -2374,7 +2390,7 @@@ F:      drivers/i2c/busses/i2c-rk3x.
  F:    sound/soc/rockchip/
  N:    rockchip
  
 -ARM/SAMSUNG EXYNOS ARM ARCHITECTURES
 +ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES
  M:    Krzysztof Kozlowski <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  L:    [email protected]
@@@ -2419,7 -2403,15 +2419,7 @@@ N:     s3c241
  N:    s3c64xx
  N:    s5pv210
  
 -ARM/SAMSUNG MOBILE MACHINE SUPPORT
 -M:    Kyungmin Park <[email protected]>
 -L:    [email protected] (moderated for non-subscribers)
 -S:    Maintained
 -F:    arch/arm/mach-s5pv210/
 -
  ARM/SAMSUNG S5P SERIES 2D GRAPHICS ACCELERATION (G2D) SUPPORT
 -M:    Kyungmin Park <[email protected]>
 -M:    Kamil Debski <[email protected]>
  M:    Andrzej Hajda <[email protected]>
  L:    [email protected]
  L:    [email protected]
@@@ -2444,6 -2436,9 +2444,6 @@@ S:      Maintaine
  F:    drivers/media/platform/s5p-jpeg/
  
  ARM/SAMSUNG S5P SERIES Multi Format Codec (MFC) SUPPORT
 -M:    Kyungmin Park <[email protected]>
 -M:    Kamil Debski <[email protected]>
 -M:    Jeongtae Park <[email protected]>
  M:    Andrzej Hajda <[email protected]>
  L:    [email protected]
  L:    [email protected]
@@@ -2490,7 -2485,7 +2490,7 @@@ F:      drivers/clk/socfpga
  ARM/SOCFPGA EDAC SUPPORT
  M:    Dinh Nguyen <[email protected]>
  S:    Maintained
 -F:    drivers/edac/altera_edac.
 +F:    drivers/edac/altera_edac.[ch]
  
  ARM/SPREADTRUM SoC SUPPORT
  M:    Orson Zhai <[email protected]>
@@@ -2968,7 -2963,7 +2968,7 @@@ ATMEL MAXTOUCH DRIVE
  M:    Nick Dyer <[email protected]>
  S:    Maintained
  T:    git git://github.com/ndyer/linux.git
 -F:    Documentation/devicetree/bindings/input/atmel,maxtouch.txt
 +F:    Documentation/devicetree/bindings/input/atmel,maxtouch.yaml
  F:    drivers/input/touchscreen/atmel_mxt_ts.c
  
  ATMEL WIRELESS DRIVER
@@@ -2987,8 -2982,6 +2987,8 @@@ L:      [email protected]
  S:    Maintained
  F:    arch/*/include/asm/atomic*.h
  F:    include/*/atomic*.h
 +F:    include/linux/refcount.h
 +F:    Documentation/atomic_*.txt
  F:    scripts/atomic/
  
  ATTO EXPRESSSAS SAS/SATA RAID SCSI DRIVER
@@@ -3127,6 -3120,8 +3127,6 @@@ Q:      https://patchwork.open-mesh.org/proj
  B:    https://www.open-mesh.org/projects/batman-adv/issues
  C:    irc://chat.freenode.net/batman
  T:    git https://git.open-mesh.org/linux-merge.git
 -F:    Documentation/ABI/obsolete/sysfs-class-net-batman-adv
 -F:    Documentation/ABI/obsolete/sysfs-class-net-mesh
  F:    Documentation/networking/batman-adv.rst
  F:    include/uapi/linux/batadv_packet.h
  F:    include/uapi/linux/batman_adv.h
@@@ -3210,9 -3205,8 +3210,9 @@@ F:      drivers/mtd/devices/block2mtd.
  BLUETOOTH DRIVERS
  M:    Marcel Holtmann <[email protected]>
  M:    Johan Hedberg <[email protected]>
 +M:    Luiz Augusto von Dentz <[email protected]>
  L:    [email protected]
 -S:    Maintained
 +S:    Supported
  W:    http://www.bluez.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
@@@ -3221,9 -3215,8 +3221,9 @@@ F:      drivers/bluetooth
  BLUETOOTH SUBSYSTEM
  M:    Marcel Holtmann <[email protected]>
  M:    Johan Hedberg <[email protected]>
 +M:    Luiz Augusto von Dentz <[email protected]>
  L:    [email protected]
 -S:    Maintained
 +S:    Supported
  W:    http://www.bluez.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
@@@ -3250,12 -3243,12 +3250,12 @@@ F:   drivers/iio/accel/bma400
  BPF (Safe dynamic programs and tools)
  M:    Alexei Starovoitov <[email protected]>
  M:    Daniel Borkmann <[email protected]>
 +M:    Andrii Nakryiko <[email protected]>
  R:    Martin KaFai Lau <[email protected]>
  R:    Song Liu <[email protected]>
  R:    Yonghong Song <[email protected]>
 -R:    Andrii Nakryiko <[email protected]>
  R:    John Fastabend <[email protected]>
 -R:    KP Singh <kpsingh@chromium.org>
 +R:    KP Singh <kpsingh@kernel.org>
  L:    [email protected]
  L:    [email protected]
  S:    Supported
@@@ -3373,17 -3366,6 +3373,17 @@@ S:    Supporte
  F:    arch/x86/net/
  X:    arch/x86/net/bpf_jit_comp32.c
  
 +BPF LSM (Security Audit and Enforcement using BPF)
 +M:    KP Singh <[email protected]>
 +R:    Florent Revest <[email protected]>
 +R:    Brendan Jackman <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/bpf/bpf_lsm.rst
 +F:    include/linux/bpf_lsm.h
 +F:    kernel/bpf/bpf_lsm.c
 +F:    security/bpf/
 +
  BROADCOM B44 10/100 ETHERNET DRIVER
  M:    Michael Chan <[email protected]>
  L:    [email protected]
@@@ -3395,7 -3377,7 +3395,7 @@@ M:      Florian Fainelli <[email protected]
  L:    [email protected]
  L:    [email protected] (subscribers-only)
  S:    Supported
 -F:    Documentation/devicetree/bindings/net/dsa/b53.txt
 +F:    Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
  F:    drivers/net/dsa/b53/*
  F:    include/linux/platform_data/b53.h
  
@@@ -3556,12 -3538,11 +3556,12 @@@ BROADCOM BRCM80211 IEEE802.11n WIRELES
  M:    Arend van Spriel <[email protected]>
  M:    Franky Lin <[email protected]>
  M:    Hante Meuleman <[email protected]>
 -M:    Chi-Hsien Lin <[email protected]>
 -M:    Wright Feng <[email protected]>
 +M:    Chi-hsien Lin <[email protected]>
 +M:    Wright Feng <[email protected]>
 +M:    Chung-hsien Hsu <[email protected]>
  L:    [email protected]
  L:    [email protected]
 -L:    brcm80211-dev-list@cypress.com
 +L:    SHA-cyfmac-dev-list@infineon.com
  S:    Supported
  F:    drivers/net/wireless/broadcom/brcm80211/
  
@@@ -3588,14 -3569,6 +3588,14 @@@ S:    Maintaine
  F:    Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.yaml
  F:    drivers/usb/host/ehci-brcm.*
  
 +BROADCOM BRCMSTB USB PIN MAP DRIVER
 +M:    Al Cooper <[email protected]>
 +L:    [email protected]
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/usb/brcm,usb-pinmap.yaml
 +F:    drivers/usb/misc/brcmstb-usb-pinmap.c
 +
  BROADCOM BRCMSTB USB2 and USB3 PHY DRIVER
  M:    Al Cooper <[email protected]>
  L:    [email protected]
@@@ -3881,11 -3854,10 +3881,11 @@@ CADENCE USB3 DRD IP DRIVE
  M:    Peter Chen <[email protected]>
  M:    Pawel Laszczak <[email protected]>
  M:    Roger Quadros <[email protected]>
 +R:    Aswath Govindraju <[email protected]>
  L:    [email protected]
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git
 -F:    Documentation/devicetree/bindings/usb/cdns-usb3.txt
 +F:    Documentation/devicetree/bindings/usb/cdns,usb3.yaml
  F:    drivers/usb/cdns3/
  
  CADET FM/AM RADIO RECEIVER DRIVER
@@@ -3897,8 -3869,9 +3897,8 @@@ T:      git git://linuxtv.org/media_tree.gi
  F:    drivers/media/radio/radio-cadet*
  
  CAFE CMOS INTEGRATED CAMERA CONTROLLER DRIVER
 -M:    Jonathan Corbet <[email protected]>
  L:    [email protected]
 -S:    Maintained
 +S:    Orphan
  T:    git git://linuxtv.org/media_tree.git
  F:    Documentation/admin-guide/media/cafe_ccic*
  F:    drivers/media/platform/marvell-ccic/
@@@ -4311,7 -4284,6 +4311,7 @@@ B:      https://github.com/ClangBuiltLinux/l
  C:    irc://chat.freenode.net/clangbuiltlinux
  F:    Documentation/kbuild/llvm.rst
  F:    scripts/clang-tools/
 +F:    scripts/lld-version.sh
  K:    \b(?i:clang|llvm)\b
  
  CLEANCACHE API
@@@ -4379,7 -4351,7 +4379,7 @@@ CODA V4L2 MEM2MEM DRIVE
  M:    Philipp Zabel <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/devicetree/bindings/media/coda.txt
 +F:    Documentation/devicetree/bindings/media/coda.yaml
  F:    drivers/media/platform/coda/
  
  CODE OF CONDUCT
  S:    Maintained
  F:    drivers/hwmon/corsair-cpro.c
  
 +CORSAIR-PSU HARDWARE MONITOR DRIVER
 +M:    Wilken Gottwalt <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/hwmon/corsair-psu.rst
 +F:    drivers/hwmon/corsair-psu.c
 +
  COSA/SRP SYNC SERIAL DRIVER
  M:    Jan "Yenya" Kasprzak <[email protected]>
  S:    Maintained
@@@ -4745,7 -4710,7 +4745,7 @@@ T:      git git://linuxtv.org/anttip/media_t
  F:    drivers/media/dvb-frontends/cxd2820r*
  
  CXGB3 ETHERNET DRIVER (CXGB3)
 -M:    Vishal Kulkarni <vishal@chelsio.com>
 +M:    Raju Rangoju <rajur@chelsio.com>
  L:    [email protected]
  S:    Supported
  W:    http://www.chelsio.com
@@@ -4777,7 -4742,7 +4777,7 @@@ W:      http://www.chelsio.co
  F:    drivers/net/ethernet/chelsio/inline_crypto/
  
  CXGB4 ETHERNET DRIVER (CXGB4)
 -M:    Vishal Kulkarni <vishal@chelsio.com>
 +M:    Raju Rangoju <rajur@chelsio.com>
  L:    [email protected]
  S:    Supported
  W:    http://www.chelsio.com
@@@ -4799,7 -4764,7 +4799,7 @@@ F:      drivers/infiniband/hw/cxgb4
  F:    include/uapi/rdma/cxgb4-abi.h
  
  CXGB4VF ETHERNET DRIVER (CXGB4VF)
 -M:    Vishal Kulkarni <vishal@gmail.com>
 +M:    Raju Rangoju <rajur@chelsio.com>
  L:    [email protected]
  S:    Supported
  W:    http://www.chelsio.com
@@@ -5023,15 -4988,6 +5023,15 @@@ M:    Mario Limonciello <mario.limonciello
  S:    Maintained
  F:    drivers/platform/x86/dell-wmi-descriptor.c
  
 +DELL WMI SYSMAN DRIVER
 +M:    Divya Bharathi <[email protected]>
 +M:    Mario Limonciello <[email protected]>
 +M:    Prasanth Ksr <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/ABI/testing/sysfs-class-firmware-attributes
 +F:    drivers/platform/x86/dell-wmi-sysman/
 +
  DELL WMI NOTIFICATIONS DRIVER
  M:    Matthew Garrett <[email protected]>
  M:    Pali Rohár <[email protected]>
@@@ -5161,9 -5117,7 +5161,9 @@@ M:      Support Opensource <support.opensour
  S:    Supported
  W:    http://www.dialog-semiconductor.com/products
  F:    Documentation/devicetree/bindings/input/da90??-onkey.txt
 +F:    Documentation/devicetree/bindings/input/dlg,da72??.txt
  F:    Documentation/devicetree/bindings/mfd/da90*.txt
 +F:    Documentation/devicetree/bindings/regulator/dlg,da9*.yaml
  F:    Documentation/devicetree/bindings/regulator/da92*.txt
  F:    Documentation/devicetree/bindings/regulator/slg51000.txt
  F:    Documentation/devicetree/bindings/sound/da[79]*.txt
@@@ -5173,7 -5127,6 +5173,7 @@@ F:      Documentation/hwmon/da90??.rs
  F:    drivers/gpio/gpio-da90??.c
  F:    drivers/hwmon/da90??-hwmon.c
  F:    drivers/iio/adc/da91??-*.c
 +F:    drivers/input/misc/da72??.[ch]
  F:    drivers/input/misc/da90??_onkey.c
  F:    drivers/input/touchscreen/da9052_tsi.c
  F:    drivers/leds/leds-da90??.c
@@@ -5189,7 -5142,6 +5189,7 @@@ F:      drivers/rtc/rtc-da90??.
  F:    drivers/thermal/da90??-thermal.c
  F:    drivers/video/backlight/da90??_bl.c
  F:    drivers/watchdog/da90??_wdt.c
 +F:    include/dt-bindings/regulator/dlg,da9*-regulator.h
  F:    include/linux/mfd/da903x.h
  F:    include/linux/mfd/da9052/
  F:    include/linux/mfd/da9055/
@@@ -5624,13 -5576,6 +5624,13 @@@ T:    git git://anongit.freedesktop.org/dr
  F:    Documentation/devicetree/bindings/display/panel/novatek,nt35510.yaml
  F:    drivers/gpu/drm/panel/panel-novatek-nt35510.c
  
 +DRM DRIVER FOR NOVATEK NT36672A PANELS
 +M:    Sumit Semwal <[email protected]>
 +S:    Maintained
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
 +F:    Documentation/devicetree/bindings/display/panel/novatek,nt36672a.yaml
 +F:    drivers/gpu/drm/panel/panel-novatek-nt36672a.c
 +
  DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS
  M:    Ben Skeggs <[email protected]>
  L:    [email protected]
@@@ -5918,7 -5863,6 +5918,7 @@@ S:      Supporte
  F:    Documentation/devicetree/bindings/display/mediatek/
  F:    drivers/gpu/drm/mediatek/
  F:    drivers/phy/mediatek/phy-mtk-hdmi*
 +F:    drivers/phy/mediatek/phy-mtk-mipi*
  
  DRM DRIVERS FOR NVIDIA TEGRA
  M:    Thierry Reding <[email protected]>
@@@ -6011,7 -5955,6 +6011,7 @@@ F:      include/uapi/drm/v3d_drm.
  
  DRM DRIVERS FOR VC4
  M:    Eric Anholt <[email protected]>
 +M:    Maxime Ripard <[email protected]>
  S:    Supported
  T:    git git://github.com/anholt/linux
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
  F:    drivers/edac/ie31200_edac.c
  
 +EDAC-IGEN6
 +M:    Tony Luck <[email protected]>
 +R:    Qiuxu Zhuo <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/edac/igen6_edac.c
 +
  EDAC-MPC85XX
  M:    Johannes Thumshirn <[email protected]>
  L:    [email protected]
@@@ -6462,7 -6398,7 +6462,7 @@@ EDAC-SKYLAK
  M:    Tony Luck <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    drivers/edac/skx_*.c
 +F:    drivers/edac/skx_*.[ch]
  
  EDAC-TI
  M:    Tero Kristo <[email protected]>
@@@ -6678,7 -6614,6 +6678,7 @@@ Q:      http://patchwork.ozlabs.org/project/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
  F:    Documentation/filesystems/ext4/
  F:    fs/ext4/
 +F:    include/trace/events/ext4.h
  
  Extended Verification Module (EVM)
  M:    Mimi Zohar <[email protected]>
@@@ -6746,6 -6681,7 +6746,7 @@@ F:      Documentation/filesystems/f2fs.rs
  F:    fs/f2fs/
  F:    include/linux/f2fs_fs.h
  F:    include/trace/events/f2fs.h
+ F:    include/uapi/linux/f2fs.h
  
  F71805F HARDWARE MONITORING DRIVER
  M:    Jean Delvare <[email protected]>
@@@ -6969,10 -6905,17 +6970,10 @@@ S:   Maintaine
  W:    http://floatingpoint.sourceforge.net/emulator/index.html
  F:    arch/x86/math-emu/
  
 -FRAME RELAY DLCI/FRAD (Sangoma drivers too)
 -L:    [email protected]
 -S:    Orphan
 -F:    drivers/net/wan/dlci.c
 -F:    drivers/net/wan/sdla.c
 -
  FRAMEBUFFER LAYER
 -M:    Bartlomiej Zolnierkiewicz <[email protected]>
  L:    [email protected]
  L:    [email protected]
 -S:    Maintained
 +S:    Orphan
  Q:    http://patchwork.kernel.org/project/linux-fbdev/list/
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  F:    Documentation/fb/
@@@ -7349,6 -7292,7 +7350,6 @@@ F:      drivers/staging/gasket
  
  GCC PLUGINS
  M:    Kees Cook <[email protected]>
 -R:    Emese Revfy <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    Documentation/kbuild/gcc-plugins.rst
@@@ -7390,17 -7334,6 +7391,17 @@@ S:    Maintaine
  F:    drivers/base/arch_topology.c
  F:    include/linux/arch_topology.h
  
 +GENERIC ENTRY CODE
 +M:    Thomas Gleixner <[email protected]>
 +M:    Peter Zijlstra <[email protected]>
 +M:    Andy Lutomirski <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/entry
 +F:    include/linux/entry-common.h
 +F:    include/linux/entry-kvm.h
 +F:    kernel/entry/
 +
  GENERIC GPIO I2C DRIVER
  M:    Wolfram Sang <[email protected]>
  S:    Supported
@@@ -7765,9 -7698,9 +7766,9 @@@ F:      drivers/clocksource/h8300_*.
  F:    drivers/irqchip/irq-renesas-h8*.c
  
  HABANALABS PCI DRIVER
 -M:    Oded Gabbay <o[email protected]>
 +M:    Oded Gabbay <o[email protected]>
  S:    Supported
 -T:    git https://github.com/HabanaAI/linux.git
 +T:    git https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git
  F:    Documentation/ABI/testing/debugfs-driver-habanalabs
  F:    Documentation/ABI/testing/sysfs-driver-habanalabs
  F:    drivers/misc/habanalabs/
@@@ -7965,15 -7898,6 +7966,15 @@@ F:    include/linux/hippidevice.
  F:    include/uapi/linux/if_hippi.h
  F:    net/802/hippi.c
  
 +HIRSCHMANN HELLCREEK ETHERNET SWITCH DRIVER
 +M:    Kurt Kanzenbach <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml
 +F:    drivers/net/dsa/hirschmann/*
 +F:    include/linux/platform_data/hirschmann-hellcreek.h
 +F:    net/dsa/tag_hellcreek.c
 +
  HISILICON DMA DRIVER
  M:    Zhou Wang <[email protected]>
  L:    [email protected]
@@@ -7993,7 -7917,7 +7994,7 @@@ HISILICON LPC BUS DRIVE
  M:    [email protected]
  S:    Maintained
  W:    http://www.hisilicon.com
 -F:    Documentation/devicetree/bindings/arm/hisilicon/hisilicon-low-pin-count.txt
 +F:    Documentation/devicetree/bindings/arm/hisilicon/low-pin-count.yaml
  F:    drivers/bus/hisi_lpc.c
  
  HISILICON NETWORK SUBSYSTEM 3 DRIVER (HNS3)
@@@ -8072,7 -7996,7 +8073,7 @@@ F:      drivers/staging/hikey9xx
  HISILICON TRUE RANDOM NUMBER GENERATOR V2 SUPPORT
  M:    Zaibo Xu <[email protected]>
  S:    Maintained
 -F:    drivers/char/hw_random/hisi-trng-v2.c
 +F:    drivers/crypto/hisilicon/trng/trng.c
  
  HISILICON V3XX SPI NOR FLASH Controller Driver
  M:    John Garry <[email protected]>
@@@ -8700,7 -8624,7 +8701,7 @@@ INA209 HARDWARE MONITOR DRIVE
  M:    Guenter Roeck <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/devicetree/bindings/hwmon/ina2xx.txt
 +F:    Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
  F:    Documentation/hwmon/ina209.rst
  F:    drivers/hwmon/ina209.c
  
@@@ -8746,16 -8670,19 +8747,16 @@@ F:   include/uapi/rdma
  F:    samples/bpf/ibumad_kern.c
  F:    samples/bpf/ibumad_user.c
  
 -INGENIC JZ4780 DMA Driver
 -M:    Zubair Lutfullah Kakakhel <[email protected]>
 -S:    Maintained
 -F:    drivers/dma/dma-jz4780.c
 -
  INGENIC JZ4780 NAND DRIVER
  M:    Harvey Hunt <[email protected]>
  L:    [email protected]
 +L:    [email protected]
  S:    Maintained
  F:    drivers/mtd/nand/raw/ingenic/
  
  INGENIC JZ47xx SoCs
  M:    Paul Cercueil <[email protected]>
 +L:    [email protected]
  S:    Maintained
  F:    arch/mips/boot/dts/ingenic/
  F:    arch/mips/generic/board-ingenic.c
@@@ -8903,8 -8830,8 +8904,8 @@@ S:      Supporte
  W:    http://www.intel.com/support/feedback.htm
  W:    http://e1000.sourceforge.net/
  Q:    http://patchwork.ozlabs.org/project/intel-wired-lan/list/
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue.git
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git
  F:    Documentation/networking/device_drivers/ethernet/intel/
  F:    drivers/net/ethernet/intel/
  F:    drivers/net/ethernet/intel/*/
@@@ -9028,23 -8955,6 +9029,23 @@@ M:    Deepak Saxena <[email protected]
  S:    Maintained
  F:    drivers/char/hw_random/ixp4xx-rng.c
  
 +INTEL KEEM BAY DRM DRIVER
 +M:    Anitha Chrisanthus <[email protected]>
 +M:    Edmund Dea <[email protected]>
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/display/intel,kmb_display.yaml
 +F:    drivers/gpu/drm/kmb/
 +
 +INTEL KEEM BAY OCS AES/SM4 CRYPTO DRIVER
 +M:    Daniele Alessandrelli <[email protected]>
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/crypto/intel,keembay-ocs-aes.yaml
 +F:    drivers/crypto/keembay/Kconfig
 +F:    drivers/crypto/keembay/Makefile
 +F:    drivers/crypto/keembay/keembay-ocs-aes-core.c
 +F:    drivers/crypto/keembay/ocs-aes.c
 +F:    drivers/crypto/keembay/ocs-aes.h
 +
  INTEL MANAGEMENT ENGINE (mei)
  M:    Tomas Winkler <[email protected]>
  L:    [email protected]
@@@ -9092,12 -9002,6 +9093,12 @@@ F:    drivers/mfd/intel_soc_pmic
  F:    include/linux/mfd/intel_msic.h
  F:    include/linux/mfd/intel_soc_pmic*
  
 +INTEL PMT DRIVER
 +M:    "David E. Box" <[email protected]>
 +S:    Maintained
 +F:    drivers/mfd/intel_pmt.c
 +F:    drivers/platform/x86/intel_pmt_*
 +
  INTEL PRO/WIRELESS 2100, 2200BG, 2915ABG NETWORK CONNECTION SUPPORT
  M:    Stanislav Yakovlev <[email protected]>
  L:    [email protected]
@@@ -9173,13 -9077,26 +9174,13 @@@ S:   Supporte
  F:    drivers/net/wireless/intel/iwlegacy/
  
  INTEL WIRELESS WIFI LINK (iwlwifi)
 -M:    Johannes Berg <[email protected]>
 -M:    Emmanuel Grumbach <[email protected]>
  M:    Luca Coelho <[email protected]>
 -M:    Intel Linux Wireless <[email protected]>
  L:    [email protected]
  S:    Supported
  W:    https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi.git
  F:    drivers/net/wireless/intel/iwlwifi/
  
 -INTEL WIRELESS WIMAX CONNECTION 2400
 -M:    Inaky Perez-Gonzalez <[email protected]>
 -M:    [email protected]
 -L:    [email protected] (subscribers-only)
 -S:    Supported
 -W:    http://linuxwimax.org
 -F:    Documentation/admin-guide/wimax/i2400m.rst
 -F:    drivers/net/wimax/i2400m/
 -F:    include/uapi/linux/wimax/i2400m.h
 -
  INTEL WMI SLIM BOOTLOADER (SBL) FIRMWARE UPDATE DRIVER
  M:    Jithu Joseph <[email protected]>
  R:    Maurice Ma <[email protected]>
@@@ -9209,19 -9126,6 +9210,19 @@@ F:    Documentation/x86/intel_txt.rs
  F:    arch/x86/kernel/tboot.c
  F:    include/linux/tboot.h
  
 +INTEL SGX
 +M:    Jarkko Sakkinen <[email protected]>
 +L:    [email protected]
 +S:    Supported
 +Q:    https://patchwork.kernel.org/project/intel-sgx/list/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-sgx.git
 +F:    Documentation/x86/sgx.rst
 +F:    arch/x86/entry/vdso/vsgx.S
 +F:    arch/x86/include/uapi/asm/sgx.h
 +F:    arch/x86/kernel/cpu/sgx/*
 +F:    tools/testing/selftests/sgx/*
 +K:    \bSGX_
 +
  INTERCONNECT API
  M:    Georgi Djakov <[email protected]>
  L:    [email protected]
@@@ -9237,7 -9141,7 +9238,7 @@@ INVENSENSE ICM-426xx IMU DRIVE
  M:    Jean-Baptiste Maneyrol <[email protected]>
  L:    [email protected]
  S:    Maintained
 -W     https://invensense.tdk.com/
 +W:    https://invensense.tdk.com/
  F:    Documentation/devicetree/bindings/iio/imu/invensense,icm42600.yaml
  F:    drivers/iio/imu/inv_icm42600/
  
@@@ -9268,7 -9172,6 +9269,7 @@@ F:      include/linux/iomap.
  
  IOMMU DRIVERS
  M:    Joerg Roedel <[email protected]>
 +M:    Will Deacon <[email protected]>
  L:    [email protected]
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
@@@ -9352,6 -9255,7 +9353,6 @@@ F:      kernel/irq
  
  IRQCHIP DRIVERS
  M:    Thomas Gleixner <[email protected]>
 -M:    Jason Cooper <[email protected]>
  M:    Marc Zyngier <[email protected]>
  L:    [email protected]
  S:    Maintained
@@@ -9717,7 -9621,7 +9718,7 @@@ F:      arch/arm64/kvm
  F:    include/kvm/arm_*
  
  KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips)
 -M:    Huacai Chen <chenh[email protected]>
 +M:    Huacai Chen <chenh[email protected]>
  M:    Aleksandar Markovic <[email protected]>
  L:    [email protected]
  L:    [email protected]
@@@ -9751,7 -9655,6 +9752,7 @@@ F:      Documentation/virt/kvm/s390
  F:    arch/s390/include/asm/gmap.h
  F:    arch/s390/include/asm/kvm*
  F:    arch/s390/include/uapi/asm/kvm*
 +F:    arch/s390/kernel/uv.c
  F:    arch/s390/kvm/
  F:    arch/s390/mm/gmap.c
  F:    tools/testing/selftests/kvm/*/s390x/
@@@ -9940,6 -9843,13 +9941,6 @@@ S:     Maintaine
  F:    arch/mips/lantiq
  F:    drivers/soc/lantiq
  
 -LAPB module
 -L:    [email protected]
 -S:    Orphan
 -F:    Documentation/networking/lapb-module.rst
 -F:    include/*/lapb.h
 -F:    net/lapb/
 -
  LASI 53c700 driver for PARISC
  M:    "James E.J. Bottomley" <[email protected]>
  L:    [email protected]
  S:    Maintained
  W:    http://www.mac.linux-m68k.org/
  F:    arch/m68k/mac/
 +F:    drivers/macintosh/adb-iop.c
 +F:    drivers/macintosh/via-macii.c
  
  M68K ON HP9000/300
  M:    Philip Blundell <[email protected]>
@@@ -10569,7 -10477,6 +10570,7 @@@ M:   Srujana Challa <[email protected]
  L:    [email protected]
  S:    Maintained
  F:    drivers/crypto/marvell/
 +F:    include/linux/soc/marvell/octeontx2/
  
  MARVELL GIGABIT ETHERNET DRIVERS (skge/sky2)
  M:    Mirko Lindner <[email protected]>
  S:    Maintained
  F:    drivers/net/ethernet/marvell/mvneta.*
  
 +MARVELL MVPP2 ETHERNET DRIVER
 +M:    Marcin Wojtas <[email protected]>
 +M:    Russell King <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/net/marvell-pp2.txt
 +F:    drivers/net/ethernet/marvell/mvpp2/
 +
  MARVELL MWIFIEX WIRELESS DRIVER
  M:    Amitkumar Karwar <[email protected]>
  M:    Ganapathi Bhat <[email protected]>
@@@ -10650,7 -10549,6 +10651,7 @@@ M:   hariprasad <[email protected]
  L:    [email protected]
  S:    Supported
  F:    drivers/net/ethernet/marvell/octeontx2/nic/
 +F:    include/linux/soc/marvell/octeontx2/
  
  MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER
  M:    Sunil Goutham <[email protected]>
@@@ -10662,13 -10560,6 +10663,13 @@@ S: Supporte
  F:    Documentation/networking/device_drivers/ethernet/marvell/octeontx2.rst
  F:    drivers/net/ethernet/marvell/octeontx2/af/
  
 +MARVELL PRESTERA ETHERNET SWITCH DRIVER
 +M:    Vadym Kochan <[email protected]>
 +M:    Taras Chornyi <[email protected]>
 +S:    Supported
 +W:    https://github.com/Marvell-switching/switchdev-prestera
 +F:    drivers/net/ethernet/marvell/prestera/
 +
  MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER
  M:    Nicolas Pitre <[email protected]>
  S:    Odd Fixes
  S:    Maintained
  T:    git git://linuxtv.org/media_tree.git
  F:    Documentation/admin-guide/media/imx7.rst
 -F:    Documentation/devicetree/bindings/media/imx7-csi.txt
 -F:    Documentation/devicetree/bindings/media/imx7-mipi-csi2.txt
 +F:    Documentation/devicetree/bindings/media/nxp,imx7-csi.yaml
 +F:    Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml
  F:    drivers/staging/media/imx/imx7-media-csi.c
  F:    drivers/staging/media/imx/imx7-mipi-csis.c
  
@@@ -11198,12 -11089,6 +11199,12 @@@ S: Maintaine
  F:    Documentation/devicetree/bindings/i2c/i2c-mt7621.txt
  F:    drivers/i2c/busses/i2c-mt7621.c
  
 +MEDIATEK MT7621 PHY PCI DRIVER
 +M:    Sergio Paracuellos <[email protected]>
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/phy/mediatek,mt7621-pci-phy.yaml
 +F:    drivers/phy/ralink/phy-mt7621-pci.c
 +
  MEDIATEK NAND CONTROLLER DRIVER
  L:    [email protected]
  S:    Orphan
@@@ -11279,10 -11164,9 +11280,10 @@@ F: Documentation/devicetree/bindings/in
  F:    drivers/input/touchscreen/melfas_mip4.c
  
  MELLANOX BLUEFIELD I2C DRIVER
 -M:    Khalil Blaiech <kblaiech@mellanox.com>
 +M:    Khalil Blaiech <kblaiech@nvidia.com>
  L:    [email protected]
  S:    Supported
 +F:    Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml
  F:    drivers/i2c/busses/i2c-mlxbf.c
  
  MELLANOX ETHERNET DRIVER (mlx4_en)
@@@ -11290,7 -11174,7 +11291,7 @@@ M:   Tariq Toukan <[email protected]
  L:    [email protected]
  S:    Supported
  W:    http://www.mellanox.com
 -Q:    http://patchwork.ozlabs.org/project/netdev/list/
 +Q:    https://patchwork.kernel.org/project/netdevbpf/list/
  F:    drivers/net/ethernet/mellanox/mlx4/en_*
  
  MELLANOX ETHERNET DRIVER (mlx5e)
@@@ -11298,7 -11182,7 +11299,7 @@@ M:   Saeed Mahameed <[email protected]
  L:    [email protected]
  S:    Supported
  W:    http://www.mellanox.com
 -Q:    http://patchwork.ozlabs.org/project/netdev/list/
 +Q:    https://patchwork.kernel.org/project/netdevbpf/list/
  F:    drivers/net/ethernet/mellanox/mlx5/core/en_*
  
  MELLANOX ETHERNET INNOVA DRIVERS
@@@ -11306,7 -11190,7 +11307,7 @@@ R:   Boris Pismenny <[email protected]
  L:    [email protected]
  S:    Supported
  W:    http://www.mellanox.com
 -Q:    http://patchwork.ozlabs.org/project/netdev/list/
 +Q:    https://patchwork.kernel.org/project/netdevbpf/list/
  F:    drivers/net/ethernet/mellanox/mlx5/core/accel/*
  F:    drivers/net/ethernet/mellanox/mlx5/core/en_accel/*
  F:    drivers/net/ethernet/mellanox/mlx5/core/fpga/*
@@@ -11318,7 -11202,7 +11319,7 @@@ M:   Ido Schimmel <[email protected]
  L:    [email protected]
  S:    Supported
  W:    http://www.mellanox.com
 -Q:    http://patchwork.ozlabs.org/project/netdev/list/
 +Q:    https://patchwork.kernel.org/project/netdevbpf/list/
  F:    drivers/net/ethernet/mellanox/mlxsw/
  F:    tools/testing/selftests/drivers/net/mlxsw/
  
  L:    [email protected]
  S:    Supported
  W:    http://www.mellanox.com
 -Q:    http://patchwork.ozlabs.org/project/netdev/list/
 +Q:    https://patchwork.kernel.org/project/netdevbpf/list/
  F:    drivers/net/ethernet/mellanox/mlxfw/
  
  MELLANOX HARDWARE PLATFORM SUPPORT
  L:    [email protected]
  S:    Supported
  W:    http://www.mellanox.com
 -Q:    http://patchwork.ozlabs.org/project/netdev/list/
 +Q:    https://patchwork.kernel.org/project/netdevbpf/list/
  F:    drivers/net/ethernet/mellanox/mlx4/
  F:    include/linux/mlx4/
  
  L:    [email protected]
  S:    Supported
  W:    http://www.mellanox.com
 -Q:    http://patchwork.ozlabs.org/project/netdev/list/
 +Q:    https://patchwork.kernel.org/project/netdevbpf/list/
  F:    Documentation/networking/device_drivers/ethernet/mellanox/
  F:    drivers/net/ethernet/mellanox/mlx5/core/
  F:    include/linux/mlx5/
@@@ -11429,7 -11313,6 +11430,7 @@@ S:   Maintaine
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git
  F:    Documentation/devicetree/bindings/memory-controllers/
  F:    drivers/memory/
 +F:    include/dt-bindings/memory/
  
  MEMORY FREQUENCY SCALING DRIVERS FOR NVIDIA TEGRA
  M:    Dmitry Osipenko <[email protected]>
  L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git
  S:    Maintained
 -F:    drivers/devfreq/tegra20-devfreq.c
  F:    drivers/devfreq/tegra30-devfreq.c
  
  MEMORY MANAGEMENT
@@@ -11509,15 -11393,6 +11510,15 @@@ F: Documentation/devicetree/bindings/me
  F:    drivers/media/cec/platform/meson/ao-cec-g12a.c
  F:    drivers/media/cec/platform/meson/ao-cec.c
  
 +MESON GE2D DRIVER FOR AMLOGIC SOCS
 +M:    Neil Armstrong <[email protected]>
 +L:    [email protected]
 +L:    [email protected]
 +S:    Supported
 +T:    git git://linuxtv.org/media_tree.git
 +F:    Documentation/devicetree/bindings/media/amlogic,axg-ge2d.yaml
 +F:    drivers/media/meson/ge2d/
 +
  MESON NAND CONTROLLER DRIVER FOR AMLOGIC SOCS
  M:    Liang Yang <[email protected]>
  L:    [email protected]
@@@ -11634,7 -11509,7 +11635,7 @@@ M:   Woojung Huh <[email protected]
  M:    Microchip Linux Driver Support <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/devicetree/bindings/net/dsa/ksz.txt
 +F:    Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
  F:    drivers/net/dsa/microchip/*
  F:    include/linux/platform_data/microchip-ksz.h
  F:    net/dsa/tag_ksz.c
@@@ -11756,54 -11631,17 +11757,54 @@@ F:        drivers/scsi/smartpqi/smartpqi*.[ch
  F:    include/linux/cciss*.h
  F:    include/uapi/linux/cciss*.h
  
 +MICROSOFT SURFACE GPE LID SUPPORT DRIVER
 +M:    Maximilian Luz <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/platform/surface/surface_gpe.c
 +
 +MICROSOFT SURFACE HARDWARE PLATFORM SUPPORT
 +M:    Hans de Goede <[email protected]>
 +M:    Mark Gross <[email protected]>
 +M:    Maximilian Luz <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git
 +F:    drivers/platform/surface/
 +
  MICROSOFT SURFACE PRO 3 BUTTON DRIVER
  M:    Chen Yu <[email protected]>
  L:    [email protected]
  S:    Supported
 -F:    drivers/platform/x86/surfacepro3_button.c
 +F:    drivers/platform/surface/surfacepro3_button.c
  
  MICROTEK X6 SCANNER
  M:    Oliver Neukum <[email protected]>
  S:    Maintained
  F:    drivers/usb/image/microtek.*
  
 +MIKROTIK CRS3XX 98DX3236 BOARD SUPPORT
 +M:    Luka Kovacic <[email protected]>
 +M:    Luka Perkov <[email protected]>
 +S:    Maintained
 +F:    arch/arm/boot/dts/armada-xp-crs305-1g-4s-bit.dts
 +F:    arch/arm/boot/dts/armada-xp-crs305-1g-4s.dts
 +F:    arch/arm/boot/dts/armada-xp-crs326-24g-2s-bit.dts
 +F:    arch/arm/boot/dts/armada-xp-crs326-24g-2s.dts
 +F:    arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s-bit.dts
 +F:    arch/arm/boot/dts/armada-xp-crs328-4c-20s-4s.dts
 +
 +MIPI CCS, SMIA AND SMIA++ IMAGE SENSOR DRIVER
 +M:    Sakari Ailus <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/media/i2c/mipi-ccs.yaml
 +F:    Documentation/driver-api/media/drivers/ccs/
 +F:    drivers/media/i2c/ccs-pll.c
 +F:    drivers/media/i2c/ccs-pll.h
 +F:    drivers/media/i2c/ccs/
 +F:    include/uapi/linux/smiapp.h
 +
  MIPS
  M:    Thomas Bogendoerfer <[email protected]>
  L:    [email protected]
@@@ -11871,7 -11709,7 +11872,7 @@@ F:   drivers/*/*/*loongson2
  F:    drivers/*/*loongson2*
  
  MIPS/LOONGSON64 ARCHITECTURE
 -M:    Huacai Chen <chenh[email protected]>
 +M:    Huacai Chen <chenh[email protected]>
  M:    Jiaxun Yang <[email protected]>
  L:    [email protected]
  S:    Maintained
@@@ -12074,7 -11912,7 +12075,7 @@@ M:   Jacopo Mondi <[email protected]
  L:    [email protected]
  S:    Maintained
  T:    git git://linuxtv.org/media_tree.git
 -F:    Documentation/devicetree/bindings/media/i2c/aptina,mt9v111.txt
 +F:    Documentation/devicetree/bindings/media/i2c/aptina,mt9v111.yaml
  F:    drivers/media/i2c/mt9v111.c
  
  MULTIFUNCTION DEVICES (MFD)
@@@ -12293,7 -12131,7 +12294,7 @@@ M:   Jakub Kicinski <[email protected]
  L:    [email protected]
  S:    Maintained
  W:    http://www.linuxfoundation.org/en/Net
 -Q:    http://patchwork.ozlabs.org/project/netdev/list/
 +Q:    https://patchwork.kernel.org/project/netdevbpf/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
  F:    Documentation/devicetree/bindings/net/
@@@ -12338,7 -12176,7 +12339,7 @@@ M:   Jakub Kicinski <[email protected]
  L:    [email protected]
  S:    Maintained
  W:    http://www.linuxfoundation.org/en/Net
 -Q:    http://patchwork.ozlabs.org/project/netdev/list/
 +Q:    https://patchwork.kernel.org/project/netdevbpf/list/
  B:    mailto:[email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
  S:    Maintained
  W:    https://github.com/multipath-tcp/mptcp_net-next/wiki
  B:    https://github.com/multipath-tcp/mptcp_net-next/issues
 +F:    Documentation/networking/mptcp-sysctl.rst
  F:    include/net/mptcp.h
  F:    include/uapi/linux/mptcp.h
  F:    net/mptcp/
@@@ -12709,7 -12546,7 +12710,7 @@@ NXP FXAS21002C DRIVE
  M:    Rui Miguel Silva <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt
 +F:    Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml
  F:    drivers/iio/gyro/fxas21002c.h
  F:    drivers/iio/gyro/fxas21002c_core.c
  F:    drivers/iio/gyro/fxas21002c_i2c.c
@@@ -12723,12 -12560,6 +12724,12 @@@ S: Maintaine
  F:    Documentation/devicetree/bindings/display/imx/nxp,imx8mq-dcss.yaml
  F:    drivers/gpu/drm/imx/dcss/
  
 +NXP PF8100/PF8121A/PF8200 PMIC REGULATOR DEVICE DRIVER
 +M:    Jagan Teki <[email protected]>
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml
 +F:    drivers/regulator/pf8x00-regulator.c
 +
  NXP PTN5150A CC LOGIC AND EXTCON DRIVER
  M:    Krzysztof Kozlowski <[email protected]>
  L:    [email protected]
@@@ -13026,14 -12857,6 +13027,14 @@@ M: Harald Welte <[email protected]
  S:    Maintained
  F:    drivers/char/pcmcia/cm4040_cs.*
  
 +OMNIVISION OV02A10 SENSOR DRIVER
 +M:    Dongchun Zhu <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +T:    git git://linuxtv.org/media_tree.git
 +F:    Documentation/devicetree/bindings/media/i2c/ovti,ov02a10.yaml
 +F:    drivers/media/i2c/ov02a10.c
 +
  OMNIVISION OV13858 SENSOR DRIVER
  M:    Sakari Ailus <[email protected]>
  L:    [email protected]
@@@ -13046,7 -12869,7 +13047,7 @@@ M:   Rui Miguel Silva <[email protected]
  L:    [email protected]
  S:    Maintained
  T:    git git://linuxtv.org/media_tree.git
 -F:    Documentation/devicetree/bindings/media/i2c/ov2680.txt
 +F:    Documentation/devicetree/bindings/media/i2c/ov2680.yaml
  F:    drivers/media/i2c/ov2680.c
  
  OMNIVISION OV2685 SENSOR DRIVER
@@@ -13104,8 -12927,9 +13105,8 @@@ T:   git git://linuxtv.org/media_tree.gi
  F:    drivers/media/i2c/ov5695.c
  
  OMNIVISION OV7670 SENSOR DRIVER
 -M:    Jonathan Corbet <[email protected]>
  L:    [email protected]
 -S:    Maintained
 +S:    Orphan
  T:    git git://linuxtv.org/media_tree.git
  F:    Documentation/devicetree/bindings/media/i2c/ov7670.txt
  F:    drivers/media/i2c/ov7670.c
@@@ -13115,7 -12939,7 +13116,7 @@@ M:   Jacopo Mondi <[email protected]
  L:    [email protected]
  S:    Odd fixes
  T:    git git://linuxtv.org/media_tree.git
 -F:    Documentation/devicetree/bindings/media/i2c/ov772x.txt
 +F:    Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml
  F:    drivers/media/i2c/ov772x.c
  F:    include/media/i2c/ov772x.h
  
@@@ -13151,14 -12975,6 +13152,14 @@@ T: git git://linuxtv.org/media_tree.gi
  F:    Documentation/devicetree/bindings/media/i2c/ov9650.txt
  F:    drivers/media/i2c/ov9650.c
  
 +OMNIVISION OV9734 SENSOR DRIVER
 +M:    Tianshu Qiu <[email protected]>
 +R:    Bingbu Cao <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +T:    git git://linuxtv.org/media_tree.git
 +F:    drivers/media/i2c/ov9734.c
 +
  ONENAND FLASH DRIVER
  M:    Kyungmin Park <[email protected]>
  L:    [email protected]
@@@ -13361,13 -13177,11 +13362,13 @@@ M:        Jesper Dangaard Brouer <hawk@kernel.
  M:    Ilias Apalodimas <[email protected]>
  L:    [email protected]
  S:    Supported
 +F:    Documentation/networking/page_pool.rst
  F:    include/net/page_pool.h
 +F:    include/trace/events/page_pool.h
  F:    net/core/page_pool.c
  
  PANASONIC LAPTOP ACPI EXTRAS DRIVER
 -M:    Harald Welte <[email protected]>
 +M:    Kenneth Chan <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    drivers/platform/x86/panasonic-laptop.c
@@@ -13591,6 -13405,7 +13592,6 @@@ F:   drivers/pci/controller/mobiveil/pcie
  
  PCI DRIVER FOR MVEBU (Marvell Armada 370 and Armada XP SOC support)
  M:    Thomas Petazzoni <[email protected]>
 -M:    Jason Cooper <[email protected]>
  L:    [email protected]
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
@@@ -13666,8 -13481,6 +13667,8 @@@ M:   Kishon Vijay Abraham I <[email protected]
  M:    Lorenzo Pieralisi <[email protected]>
  L:    [email protected]
  S:    Supported
 +F:    Documentation/PCI/endpoint/*
 +F:    Documentation/misc-devices/pci-endpoint-test.rst
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kishon/pci-endpoint.git
  F:    drivers/misc/pci_endpoint_test.c
  F:    drivers/pci/endpoint/
@@@ -14091,13 -13904,6 +14092,13 @@@ M: Logan Gunthorpe <[email protected]
  S:    Maintained
  F:    drivers/dma/plx_dma.c
  
 +PM6764TR DRIVER
 +M:    Charles Hsu     <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/hwmon/pm6764tr.rst
 +F:    drivers/hwmon/pmbus/pm6764tr.c
 +
  PM-GRAPH UTILITY
  M:    "Todd E Brandt" <[email protected]>
  L:    [email protected]
@@@ -14405,6 -14211,7 +14406,6 @@@ F:   drivers/media/usb/pwc/
  F:    include/trace/events/pwc.h
  
  PWM FAN DRIVER
 -M:    Kamil Debski <[email protected]>
  M:    Bartlomiej Zolnierkiewicz <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -14640,7 -14447,6 +14641,7 @@@ W:   https://wireless.wiki.kernel.org/en/
  F:    drivers/net/wireless/ath/ath9k/
  
  QUALCOMM CAMERA SUBSYSTEM DRIVER
 +M:    Robert Foss <[email protected]>
  M:    Todor Tomov <[email protected]>
  L:    [email protected]
  S:    Maintained
@@@ -14722,22 -14528,6 +14723,22 @@@ F: Documentation/devicetree/bindings/ma
  F:    drivers/mailbox/qcom-ipcc.c
  F:    include/dt-bindings/mailbox/qcom-ipcc.h
  
 +QUALCOMM IPQ4019 USB PHY DRIVER
 +M:    Robert Marko <[email protected]>
 +M:    Luka Perkov <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/phy/qcom-usb-ipq4019-phy.yaml
 +F:    drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c
 +
 +QUALCOMM IPQ4019 VQMMC REGULATOR DRIVER
 +M:    Robert Marko <[email protected]>
 +M:    Luka Perkov <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/regulator/vqmmc-ipq4019-regulator.yaml
 +F:    drivers/regulator/vqmmc-ipq4019-regulator.c
 +
  QUALCOMM RMNET DRIVER
  M:    Subash Abhinov Kasiviswanathan <[email protected]>
  M:    Sean Tranchetti <[email protected]>
@@@ -15022,7 -14812,7 +15023,7 @@@ T:   git git://git.kernel.org/pub/scm/lin
  F:    drivers/net/wireless/realtek/rtlwifi/
  
  REALTEK WIRELESS DRIVER (rtw88)
 -M:    Yan-Hsuan Chuang <yhchuang@realtek.com>
 +M:    Yan-Hsuan Chuang <tony0620emma@gmail.com>
  L:    [email protected]
  S:    Maintained
  F:    drivers/net/wireless/realtek/rtw88/
@@@ -15093,6 -14883,7 +15094,6 @@@ RENESAS ETHERNET DRIVER
  R:    Sergei Shtylyov <[email protected]>
  L:    [email protected]
  L:    [email protected]
 -F:    Documentation/devicetree/bindings/net/renesas,*.txt
  F:    Documentation/devicetree/bindings/net/renesas,*.yaml
  F:    drivers/net/ethernet/renesas/
  F:    include/linux/sh_eth.h
@@@ -15138,7 -14929,6 +15139,7 @@@ M:   Philipp Zabel <[email protected]
  S:    Maintained
  T:    git git://git.pengutronix.de/git/pza/linux
  F:    Documentation/devicetree/bindings/reset/
 +F:    Documentation/driver-api/reset.rst
  F:    drivers/reset/
  F:    include/dt-bindings/reset/
  F:    include/linux/reset-controller.h
@@@ -15223,13 -15013,10 +15224,13 @@@ ROCKCHIP ISP V1 DRIVE
  M:    Helen Koike <[email protected]>
  M:    Dafna Hirschfeld <[email protected]>
  L:    [email protected]
 +L:    [email protected]
  S:    Maintained
  F:    Documentation/admin-guide/media/rkisp1.rst
 +F:    Documentation/devicetree/bindings/media/rockchip-isp1.yaml
  F:    Documentation/userspace-api/media/v4l/pixfmt-meta-rkisp1.rst
 -F:    drivers/staging/media/rkisp1/
 +F:    drivers/media/platform/rockchip/rkisp1
 +F:    include/uapi/linux/rkisp1-config.h
  
  ROCKCHIP RASTER 2D GRAPHIC ACCELERATION UNIT DRIVER
  M:    Jacob Chen <[email protected]>
@@@ -15453,6 -15240,7 +15454,6 @@@ F:   drivers/iommu/s390-iommu.
  S390 IUCV NETWORK LAYER
  M:    Julian Wiedmann <[email protected]>
  M:    Karsten Graul <[email protected]>
 -M:    Ursula Braun <[email protected]>
  L:    [email protected]
  S:    Supported
  W:    http://www.ibm.com/developerworks/linux/linux390/
@@@ -15463,6 -15251,7 +15464,6 @@@ F:   net/iucv
  S390 NETWORK DRIVERS
  M:    Julian Wiedmann <[email protected]>
  M:    Karsten Graul <[email protected]>
 -M:    Ursula Braun <[email protected]>
  L:    [email protected]
  S:    Supported
  W:    http://www.ibm.com/developerworks/linux/linux390/
  S:    Maintained
  F:    drivers/video/fbdev/s3c-fb.c
  
 +SAMSUNG INTERCONNECT DRIVERS
 +M:    Sylwester Nawrocki <[email protected]>
 +M:    Artur Świgoń <[email protected]>
 +L:    [email protected]
 +L:    [email protected]
 +S:    Supported
 +F:    drivers/interconnect/samsung/
 +
  SAMSUNG LAPTOP DRIVER
  M:    Corentin Chary <[email protected]>
  L:    [email protected]
@@@ -15639,12 -15420,14 +15640,12 @@@ F:        Documentation/devicetree/bindings/ne
  F:    drivers/nfc/s3fwrn5
  
  SAMSUNG S5C73M3 CAMERA DRIVER
 -M:    Kyungmin Park <[email protected]>
  M:    Andrzej Hajda <[email protected]>
  L:    [email protected]
  S:    Supported
  F:    drivers/media/i2c/s5c73m3/*
  
  SAMSUNG S5K5BAF CAMERA DRIVER
 -M:    Kyungmin Park <[email protected]>
  M:    Andrzej Hajda <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -15662,6 -15445,7 +15663,6 @@@ F:   Documentation/devicetree/bindings/cr
  F:    drivers/crypto/s5p-sss.c
  
  SAMSUNG S5P/EXYNOS4 SOC SERIES CAMERA SUBSYSTEM DRIVERS
 -M:    Kyungmin Park <[email protected]>
  M:    Sylwester Nawrocki <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -15709,6 -15493,7 +15710,6 @@@ T:   git https://github.com/lmajewski/lin
  F:    drivers/thermal/samsung/
  
  SAMSUNG USB2 PHY DRIVER
 -M:    Kamil Debski <[email protected]>
  M:    Sylwester Nawrocki <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -15802,15 -15587,6 +15803,15 @@@ F: Documentation/scsi/st.rs
  F:    drivers/scsi/st.*
  F:    drivers/scsi/st_*.h
  
 +SCSI TARGET CORE USER DRIVER
 +M:    Bodo Stroesser <[email protected]>
 +L:    [email protected]
 +L:    [email protected]
 +S:    Supported
 +F:    Documentation/target/tcmu-design.rst
 +F:    drivers/target/target_core_user.c
 +F:    include/uapi/linux/target_core_user.h
 +
  SCSI TARGET SUBSYSTEM
  M:    "Martin K. Petersen" <[email protected]>
  L:    [email protected]
@@@ -16016,8 -15792,9 +16017,8 @@@ F:   drivers/slimbus
  F:    include/linux/slimbus.h
  
  SFC NETWORK DRIVER
 -M:    Solarflare linux maintainers <[email protected]>
 -M:    Edward Cree <[email protected]>
 -M:    Martin Habets <[email protected]>
 +M:    Edward Cree <[email protected]>
 +M:    Martin Habets <[email protected]>
  L:    [email protected]
  S:    Supported
  F:    drivers/net/ethernet/sfc/
@@@ -16034,18 -15811,18 +16035,18 @@@ F:        include/linux/sfp.
  K:    phylink\.h|struct\s+phylink|\.phylink|>phylink_|phylink_(autoneg|clear|connect|create|destroy|disconnect|ethtool|helper|mac|mii|of|set|start|stop|test|validate)
  
  SGI GRU DRIVER
 -M:    Dimitri Sivanich <sivanich@sgi.com>
 +M:    Dimitri Sivanich <dimitri.sivanich@hpe.com>
  S:    Maintained
  F:    drivers/misc/sgi-gru/
  
  SGI XP/XPC/XPNET DRIVER
 -M:    Cliff Whickman <[email protected]>
  M:    Robin Holt <[email protected]>
 +M:    Steve Wahl <[email protected]>
 +R:    Mike Travis <[email protected]>
  S:    Maintained
  F:    drivers/misc/sgi-xp/
  
  SHARED MEMORY COMMUNICATIONS (SMC) SOCKETS
 -M:    Ursula Braun <[email protected]>
  M:    Karsten Graul <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -16326,6 -16103,16 +16327,6 @@@ S:  Maintaine
  F:    drivers/firmware/smccc/
  F:    include/linux/arm-smccc.h
  
 -SMIA AND SMIA++ IMAGE SENSOR DRIVER
 -M:    Sakari Ailus <[email protected]>
 -L:    [email protected]
 -S:    Maintained
 -F:    Documentation/devicetree/bindings/media/i2c/nokia,smia.txt
 -F:    drivers/media/i2c/smiapp-pll.c
 -F:    drivers/media/i2c/smiapp-pll.h
 -F:    drivers/media/i2c/smiapp/
 -F:    include/uapi/linux/smiapp.h
 -
  SMM665 HARDWARE MONITOR DRIVER
  M:    Guenter Roeck <[email protected]>
  L:    [email protected]
@@@ -16421,7 -16208,7 +16422,7 @@@ F:   drivers/infiniband/sw/siw
  F:    include/uapi/rdma/siw-abi.h
  
  SOFT-ROCE DRIVER (rxe)
 -M:    Zhu Yanjun <yanjunz@nvidia.com>
 +M:    Zhu Yanjun <zyjzyj2000@gmail.com>
  L:    [email protected]
  S:    Supported
  F:    drivers/infiniband/sw/rxe/
@@@ -16488,7 -16275,7 +16489,7 @@@ M:   Ricardo Ribalda <[email protected]
  L:    [email protected]
  S:    Maintained
  T:    git git://linuxtv.org/media_tree.git
 -F:    Documentation/devicetree/bindings/media/i2c/sony,imx214.txt
 +F:    Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml
  F:    drivers/media/i2c/imx214.c
  
  SONY IMX219 SENSOR DRIVER
@@@ -16724,10 -16511,8 +16725,10 @@@ F: Documentation/networking/device_driv
  F:    drivers/net/ethernet/toshiba/spider_net*
  
  SPMI SUBSYSTEM
 -R:    Stephen Boyd <[email protected]>
 -L:    [email protected]
 +M:    Stephen Boyd <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git
  F:    Documentation/devicetree/bindings/spmi/
  F:    drivers/spmi/
  F:    include/dt-bindings/spmi/spmi.h
@@@ -17587,12 -17372,6 +17588,12 @@@ W: http://thinkwiki.org/wiki/Ibm-acp
  T:    git git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git
  F:    drivers/platform/x86/thinkpad_acpi.c
  
 +THUNDERBOLT DMA TRAFFIC TEST DRIVER
 +M:    Isaac Hazan <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/thunderbolt/dma_test.c
 +
  THUNDERBOLT DRIVER
  M:    Andreas Noever <[email protected]>
  M:    Michael Jamet <[email protected]>
@@@ -18305,7 -18084,7 +18306,7 @@@ M:   Yu Chen <[email protected]
  M:    Binghui Wang <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/devicetree/bindings/phy/phy-hi3660-usb3.txt
 +F:    Documentation/devicetree/bindings/phy/hisilicon,hi3660-usb3.yaml
  F:    drivers/phy/hisilicon/phy-hi3660-usb3.c
  
  USB ISP116X DRIVER
  S:    Supported
  F:    drivers/usb/class/usblp.c
  
 +USB RAW GADGET DRIVER
 +R:    Andrey Konovalov <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/usb/raw-gadget.rst
 +F:    drivers/usb/gadget/legacy/raw_gadget.c
 +F:    include/uapi/linux/usb/raw_gadget.h
 +
  USB QMI WWAN NETWORK DRIVER
  M:    Bjørn Mork <[email protected]>
  L:    [email protected]
@@@ -18592,12 -18363,6 +18593,12 @@@ F: include/uapi/linux/uuid.
  F:    lib/test_uuid.c
  F:    lib/uuid.c
  
 +UV SYSFS DRIVER
 +M:    Justin Ernst <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/platform/x86/uv_sysfs.c
 +
  UVESAFB DRIVER
  M:    Michal Januszewski <[email protected]>
  L:    [email protected]
@@@ -19120,6 -18885,18 +19121,6 @@@ S:  Supporte
  W:    https://wireless.wiki.kernel.org/en/users/Drivers/wil6210
  F:    drivers/net/wireless/ath/wil6210/
  
 -WIMAX STACK
 -M:    Inaky Perez-Gonzalez <[email protected]>
 -M:    [email protected]
 -L:    [email protected] (subscribers-only)
 -S:    Supported
 -W:    http://linuxwimax.org
 -F:    Documentation/admin-guide/wimax/wimax.rst
 -F:    include/linux/wimax/debug.h
 -F:    include/net/wimax.h
 -F:    include/uapi/linux/wimax.h
 -F:    net/wimax/
 -
  WINBOND CIR DRIVER
  M:    David Härdeman <[email protected]>
  S:    Maintained
@@@ -19217,18 -18994,12 +19218,18 @@@ L:        [email protected]
  S:    Maintained
  N:    axp[128]
  
 -X.25 NETWORK LAYER
 -M:    Andrew Hendry <[email protected]>
 +X.25 STACK
 +M:    Martin Schiller <[email protected]>
  L:    [email protected]
 -S:    Odd Fixes
 +S:    Maintained
 +F:    Documentation/networking/lapb-module.rst
  F:    Documentation/networking/x25*
 +F:    drivers/net/wan/hdlc_x25.c
 +F:    drivers/net/wan/lapbether.c
 +F:    include/*/lapb.h
  F:    include/net/x25*
 +F:    include/uapi/linux/x25.h
 +F:    net/lapb/
  F:    net/x25/
  
  X86 ARCHITECTURE (32-BIT AND 64-BIT)
@@@ -19292,7 -19063,6 +19293,7 @@@ F:   arch/x86/platfor
  
  X86 PLATFORM UV HPE SUPERDOME FLEX
  M:    Steve Wahl <[email protected]>
 +R:    Mike Travis <[email protected]>
  R:    Dimitri Sivanich <[email protected]>
  R:    Russ Anderson <[email protected]>
  S:    Supported
@@@ -19343,17 -19113,12 +19344,17 @@@ L:        [email protected]
  L:    [email protected]
  S:    Supported
  F:    include/net/xdp.h
 +F:    include/net/xdp_priv.h
  F:    include/trace/events/xdp.h
  F:    kernel/bpf/cpumap.c
  F:    kernel/bpf/devmap.c
  F:    net/core/xdp.c
 -N:    xdp
 -K:    xdp
 +F:    samples/bpf/xdp*
 +F:    tools/testing/selftests/bpf/*xdp*
 +F:    tools/testing/selftests/bpf/*/*xdp*
 +F:    drivers/net/ethernet/*/*/*/*/*xdp*
 +F:    drivers/net/ethernet/*/*/*xdp*
 +K:    (?:\b|_)xdp(?:\b|_)
  
  XDP SOCKETS (AF_XDP)
  M:    Björn Töpel <[email protected]>
@@@ -19362,12 -19127,9 +19363,12 @@@ R: Jonathan Lemon <jonathan.lemon@gmail
  L:    [email protected]
  L:    [email protected]
  S:    Maintained
 +F:    Documentation/networking/af_xdp.rst
  F:    include/net/xdp_sock*
  F:    include/net/xsk_buff_pool.h
  F:    include/uapi/linux/if_xdp.h
 +F:    include/uapi/linux/xdp_diag.h
 +F:    include/net/netns/xdp.h
  F:    net/xdp/
  F:    samples/bpf/xdpsock*
  F:    tools/lib/bpf/xsk*
@@@ -19635,13 -19397,6 +19636,13 @@@ T: git git://git.kernel.org/pub/scm/lin
  F:    Documentation/filesystems/zonefs.rst
  F:    fs/zonefs/
  
 +ZPOOL COMPRESSED PAGE STORAGE API
 +M:    Dan Streetman <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    include/linux/zpool.h
 +F:    mm/zpool.c
 +
  ZR36067 VIDEO FOR LINUX DRIVER
  M:    Corentin Labbe <[email protected]>
  L:    [email protected]
@@@ -19652,6 -19407,13 +19653,6 @@@ Q:  https://patchwork.linuxtv.org/projec
  F:    Documentation/driver-api/media/drivers/zoran.rst
  F:    drivers/staging/media/zoran/
  
 -ZPOOL COMPRESSED PAGE STORAGE API
 -M:    Dan Streetman <[email protected]>
 -L:    [email protected]
 -S:    Maintained
 -F:    include/linux/zpool.h
 -F:    mm/zpool.c
 -
  ZRAM COMPRESSED RAM BLOCK DEVICE DRVIER
  M:    Minchan Kim <[email protected]>
  M:    Nitin Gupta <[email protected]>
diff --combined fs/crypto/fname.c
index 3414d35ccbb64bfba9ab9f3085cb0a732803aabe,cb3cfa6329ba2daa69ae94592233373829505b56..6ca7d16593ff6504b81a5b73517119271a45d2d2
@@@ -14,7 -14,7 +14,7 @@@
  #include <linux/namei.h>
  #include <linux/scatterlist.h>
  #include <crypto/hash.h>
 -#include <crypto/sha.h>
 +#include <crypto/sha2.h>
  #include <crypto/skcipher.h>
  #include "fscrypt_private.h"
  
@@@ -404,7 -404,7 +404,7 @@@ int fscrypt_setup_filename(struct inod
                fname->disk_name.len = iname->len;
                return 0;
        }
 -      ret = fscrypt_get_encryption_info(dir);
 +      ret = fscrypt_get_encryption_info(dir, lookup);
        if (ret)
                return ret;
  
@@@ -560,11 -560,7 +560,11 @@@ int fscrypt_d_revalidate(struct dentry 
                return -ECHILD;
  
        dir = dget_parent(dentry);
 -      err = fscrypt_get_encryption_info(d_inode(dir));
 +      /*
 +       * Pass allow_unsupported=true, so that files with an unsupported
 +       * encryption policy can be deleted.
 +       */
 +      err = fscrypt_get_encryption_info(d_inode(dir), true);
        valid = !fscrypt_has_encryption_key(d_inode(dir));
        dput(dir);
  
        return valid;
  }
  EXPORT_SYMBOL_GPL(fscrypt_d_revalidate);
- const struct dentry_operations fscrypt_d_ops = {
-       .d_revalidate = fscrypt_d_revalidate,
- };
index f0bed6b06fa69d763befb4dcf776450ed3cde13e,df9c48c1fbf7d2f066e4d36bfe0fa0696003bfbc..3fa965eb3336dab7209ad30609eb5187b8b20706
@@@ -25,9 -25,6 +25,9 @@@
  #define FSCRYPT_CONTEXT_V1    1
  #define FSCRYPT_CONTEXT_V2    2
  
 +/* Keep this in sync with include/uapi/linux/fscrypt.h */
 +#define FSCRYPT_MODE_MAX      FSCRYPT_MODE_ADIANTUM
 +
  struct fscrypt_context_v1 {
        u8 version; /* FSCRYPT_CONTEXT_V1 */
        u8 contents_encryption_mode;
@@@ -297,7 -294,6 +297,6 @@@ int fscrypt_fname_encrypt(const struct 
  bool fscrypt_fname_encrypted_size(const union fscrypt_policy *policy,
                                  u32 orig_len, u32 max_len,
                                  u32 *encrypted_len_ret);
- extern const struct dentry_operations fscrypt_d_ops;
  
  /* hkdf.c */
  
@@@ -439,9 -435,16 +438,9 @@@ struct fscrypt_master_key 
         * FS_IOC_REMOVE_ENCRYPTION_KEY can be retried, or
         * FS_IOC_ADD_ENCRYPTION_KEY can add the secret again.
         *
 -       * Locking: protected by key->sem (outer) and mk_secret_sem (inner).
 -       * The reason for two locks is that key->sem also protects modifying
 -       * mk_users, which ranks it above the semaphore for the keyring key
 -       * type, which is in turn above page faults (via keyring_read).  But
 -       * sometimes filesystems call fscrypt_get_encryption_info() from within
 -       * a transaction, which ranks it below page faults.  So we need a
 -       * separate lock which protects mk_secret but not also mk_users.
 +       * Locking: protected by this master key's key->sem.
         */
        struct fscrypt_master_key_secret        mk_secret;
 -      struct rw_semaphore                     mk_secret_sem;
  
        /*
         * For v1 policy keys: an arbitrary key descriptor which was assigned by
         *
         * This is NULL for v1 policy keys; those can only be added by root.
         *
 -       * Locking: in addition to this keyrings own semaphore, this is
 -       * protected by the master key's key->sem, so we can do atomic
 +       * Locking: in addition to this keyring's own semaphore, this is
 +       * protected by this master key's key->sem, so we can do atomic
         * search+insert.  It can also be searched without taking any locks, but
         * in that case the returned key may have already been removed.
         */
         * Per-mode encryption keys for the various types of encryption policies
         * that use them.  Allocated and derived on-demand.
         */
 -      struct fscrypt_prepared_key mk_direct_keys[__FSCRYPT_MODE_MAX + 1];
 -      struct fscrypt_prepared_key mk_iv_ino_lblk_64_keys[__FSCRYPT_MODE_MAX + 1];
 -      struct fscrypt_prepared_key mk_iv_ino_lblk_32_keys[__FSCRYPT_MODE_MAX + 1];
 +      struct fscrypt_prepared_key mk_direct_keys[FSCRYPT_MODE_MAX + 1];
 +      struct fscrypt_prepared_key mk_iv_ino_lblk_64_keys[FSCRYPT_MODE_MAX + 1];
 +      struct fscrypt_prepared_key mk_iv_ino_lblk_32_keys[FSCRYPT_MODE_MAX + 1];
  
        /* Hash key for inode numbers.  Initialized only when needed. */
        siphash_key_t           mk_ino_hash_key;
@@@ -503,9 -506,9 +502,9 @@@ is_master_key_secret_present(const stru
        /*
         * The READ_ONCE() is only necessary for fscrypt_drop_inode() and
         * fscrypt_key_describe().  These run in atomic context, so they can't
 -       * take ->mk_secret_sem and thus 'secret' can change concurrently which
 -       * would be a data race.  But they only need to know whether the secret
 -       * *was* present at the time of check, so READ_ONCE() suffices.
 +       * take the key semaphore and thus 'secret' can change concurrently
 +       * which would be a data race.  But they only need to know whether the
 +       * secret *was* present at the time of check, so READ_ONCE() suffices.
         */
        return READ_ONCE(secret->size) != 0;
  }
@@@ -571,34 -574,6 +570,34 @@@ int fscrypt_derive_dirhash_key(struct f
  void fscrypt_hash_inode_number(struct fscrypt_info *ci,
                               const struct fscrypt_master_key *mk);
  
 +int fscrypt_get_encryption_info(struct inode *inode, bool allow_unsupported);
 +
 +/**
 + * fscrypt_require_key() - require an inode's encryption key
 + * @inode: the inode we need the key for
 + *
 + * If the inode is encrypted, set up its encryption key if not already done.
 + * Then require that the key be present and return -ENOKEY otherwise.
 + *
 + * No locks are needed, and the key will live as long as the struct inode --- so
 + * it won't go away from under you.
 + *
 + * Return: 0 on success, -ENOKEY if the key is missing, or another -errno code
 + * if a problem occurred while setting up the encryption key.
 + */
 +static inline int fscrypt_require_key(struct inode *inode)
 +{
 +      if (IS_ENCRYPTED(inode)) {
 +              int err = fscrypt_get_encryption_info(inode, false);
 +
 +              if (err)
 +                      return err;
 +              if (!fscrypt_has_encryption_key(inode))
 +                      return -ENOKEY;
 +      }
 +      return 0;
 +}
 +
  /* keysetup_v1.c */
  
  void fscrypt_put_direct_key(struct fscrypt_direct_key *dk);
diff --combined fs/crypto/hooks.c
index 79570e0e8e619e688a77de2bb00cd03610872f83,9006fa98333576771c75dbd415f94abb031a8f2d..a73b0376e6f379bd130a366832e7cd6b2b38069f
@@@ -54,12 -54,15 +54,12 @@@ EXPORT_SYMBOL_GPL(fscrypt_file_open)
  int __fscrypt_prepare_link(struct inode *inode, struct inode *dir,
                           struct dentry *dentry)
  {
 -      int err;
 -
 -      err = fscrypt_require_key(dir);
 -      if (err)
 -              return err;
 -
 -      /* ... in case we looked up no-key name before key was added */
 -      if (dentry->d_flags & DCACHE_NOKEY_NAME)
 +      if (fscrypt_is_nokey_name(dentry))
                return -ENOKEY;
 +      /*
 +       * We don't need to separately check that the directory inode's key is
 +       * available, as it's implied by the dentry not being a no-key name.
 +       */
  
        if (!fscrypt_has_permitted_context(dir, inode))
                return -EXDEV;
@@@ -72,13 -75,19 +72,13 @@@ int __fscrypt_prepare_rename(struct ino
                             struct inode *new_dir, struct dentry *new_dentry,
                             unsigned int flags)
  {
 -      int err;
 -
 -      err = fscrypt_require_key(old_dir);
 -      if (err)
 -              return err;
 -
 -      err = fscrypt_require_key(new_dir);
 -      if (err)
 -              return err;
 -
 -      /* ... in case we looked up no-key name(s) before key was added */
 -      if ((old_dentry->d_flags | new_dentry->d_flags) & DCACHE_NOKEY_NAME)
 +      if (fscrypt_is_nokey_name(old_dentry) ||
 +          fscrypt_is_nokey_name(new_dentry))
                return -ENOKEY;
 +      /*
 +       * We don't need to separately check that the directory inodes' keys are
 +       * available, as it's implied by the dentries not being no-key names.
 +       */
  
        if (old_dir != new_dir) {
                if (IS_ENCRYPTED(new_dir) &&
@@@ -108,26 -117,11 +108,25 @@@ int __fscrypt_prepare_lookup(struct ino
                spin_lock(&dentry->d_lock);
                dentry->d_flags |= DCACHE_NOKEY_NAME;
                spin_unlock(&dentry->d_lock);
-               d_set_d_op(dentry, &fscrypt_d_ops);
        }
        return err;
  }
  EXPORT_SYMBOL_GPL(__fscrypt_prepare_lookup);
  
 +int __fscrypt_prepare_readdir(struct inode *dir)
 +{
 +      return fscrypt_get_encryption_info(dir, true);
 +}
 +EXPORT_SYMBOL_GPL(__fscrypt_prepare_readdir);
 +
 +int __fscrypt_prepare_setattr(struct dentry *dentry, struct iattr *attr)
 +{
 +      if (attr->ia_valid & ATTR_SIZE)
 +              return fscrypt_require_key(d_inode(dentry));
 +      return 0;
 +}
 +EXPORT_SYMBOL_GPL(__fscrypt_prepare_setattr);
 +
  /**
   * fscrypt_prepare_setflags() - prepare to change flags with FS_IOC_SETFLAGS
   * @inode: the inode on which flags are being changed
@@@ -143,7 -137,6 +142,7 @@@ int fscrypt_prepare_setflags(struct ino
                             unsigned int oldflags, unsigned int flags)
  {
        struct fscrypt_info *ci;
 +      struct key *key;
        struct fscrypt_master_key *mk;
        int err;
  
                ci = inode->i_crypt_info;
                if (ci->ci_policy.version != FSCRYPT_POLICY_V2)
                        return -EINVAL;
 -              mk = ci->ci_master_key->payload.data[0];
 -              down_read(&mk->mk_secret_sem);
 +              key = ci->ci_master_key;
 +              mk = key->payload.data[0];
 +              down_read(&key->sem);
                if (is_master_key_secret_present(&mk->mk_secret))
                        err = fscrypt_derive_dirhash_key(ci, mk);
                else
                        err = -ENOKEY;
 -              up_read(&mk->mk_secret_sem);
 +              up_read(&key->sem);
                return err;
        }
        return 0;
@@@ -332,7 -324,7 +331,7 @@@ const char *fscrypt_get_symlink(struct 
         * Try to set up the symlink's encryption key, but we can continue
         * regardless of whether the key is available or not.
         */
 -      err = fscrypt_get_encryption_info(inode);
 +      err = fscrypt_get_encryption_info(inode, false);
        if (err)
                return ERR_PTR(err);
        has_key = fscrypt_has_encryption_key(inode);
diff --combined fs/ext4/dir.c
index c6d16353326a987f04a4cf6aa689bd6afed6664b,e757319a4472dd79741d26255eaa12af59bf8509..5ed870614c8dfcdf8eaabf1036f514649f580b9c
@@@ -118,9 -118,11 +118,9 @@@ static int ext4_readdir(struct file *fi
        struct buffer_head *bh = NULL;
        struct fscrypt_str fstr = FSTR_INIT(NULL, 0);
  
 -      if (IS_ENCRYPTED(inode)) {
 -              err = fscrypt_get_encryption_info(inode);
 -              if (err)
 -                      return err;
 -      }
 +      err = fscrypt_prepare_readdir(inode);
 +      if (err)
 +              return err;
  
        if (is_dx_dir(inode)) {
                err = ext4_dx_readdir(file, ctx);
@@@ -614,6 -616,13 +614,6 @@@ finished
        return 0;
  }
  
 -static int ext4_dir_open(struct inode * inode, struct file * filp)
 -{
 -      if (IS_ENCRYPTED(inode))
 -              return fscrypt_get_encryption_info(inode) ? -EACCES : 0;
 -      return 0;
 -}
 -
  static int ext4_release_dir(struct inode *inode, struct file *filp)
  {
        if (filp->private_data)
@@@ -655,12 -664,6 +655,5 @@@ const struct file_operations ext4_dir_o
        .compat_ioctl   = ext4_compat_ioctl,
  #endif
        .fsync          = ext4_sync_file,
 -      .open           = ext4_dir_open,
        .release        = ext4_release_dir,
  };
- #ifdef CONFIG_UNICODE
- const struct dentry_operations ext4_dentry_ops = {
-       .d_hash = generic_ci_d_hash,
-       .d_compare = generic_ci_d_compare,
- };
- #endif
diff --combined fs/ext4/ext4.h
index 65ecaf96d0a4dbc17b8066a3f66fccbc82cf923e,983f2b970d6a7b483e558faa75e7366d6009de13..c64ea8f59ea7f781182d9ab0cd0457d798973a88
@@@ -1028,6 -1028,9 +1028,6 @@@ struct ext4_inode_info 
                                         * protected by sbi->s_fc_lock.
                                         */
  
 -      /* Fast commit subtid when this inode was committed */
 -      unsigned int i_fc_committed_subtid;
 -
        /* Start of lblk range that needs to be committed in this fast commit */
        ext4_lblk_t i_fc_lblk_start;
  
                                                      blocks */
  #define EXT4_MOUNT2_HURD_COMPAT               0x00000004 /* Support HURD-castrated
                                                      file systems */
 -#define EXT4_MOUNT2_DAX_NEVER         0x00000008 /* Do not allow Direct Access */
 -#define EXT4_MOUNT2_DAX_INODE         0x00000010 /* For printing options only */
 -
  #define EXT4_MOUNT2_EXPLICIT_JOURNAL_CHECKSUM 0x00000008 /* User explicitly
                                                specified journal checksum */
  
  #define EXT4_MOUNT2_JOURNAL_FAST_COMMIT       0x00000010 /* Journal fast commit */
 +#define EXT4_MOUNT2_DAX_NEVER         0x00000020 /* Do not allow Direct Access */
 +#define EXT4_MOUNT2_DAX_INODE         0x00000040 /* For printing options only */
 +
  
  #define clear_opt(sb, opt)            EXT4_SB(sb)->s_mount_opt &= \
                                                ~EXT4_MOUNT_##opt
@@@ -1419,6 -1422,16 +1419,6 @@@ struct ext4_super_block 
  
  #ifdef __KERNEL__
  
 -/*
 - * run-time mount flags
 - */
 -#define EXT4_MF_MNTDIR_SAMPLED                0x0001
 -#define EXT4_MF_FS_ABORTED            0x0002  /* Fatal error detected */
 -#define EXT4_MF_FC_INELIGIBLE         0x0004  /* Fast commit ineligible */
 -#define EXT4_MF_FC_COMMITTING         0x0008  /* File system underoing a fast
 -                                               * commit.
 -                                               */
 -
  #ifdef CONFIG_FS_ENCRYPTION
  #define DUMMY_ENCRYPTION_ENABLED(sbi) ((sbi)->s_dummy_enc_policy.policy != NULL)
  #else
@@@ -1453,7 -1466,7 +1453,7 @@@ struct ext4_sb_info 
        struct buffer_head * __rcu *s_group_desc;
        unsigned int s_mount_opt;
        unsigned int s_mount_opt2;
 -      unsigned int s_mount_flags;
 +      unsigned long s_mount_flags;
        unsigned int s_def_mount_opt;
        ext4_fsblk_t s_sb_block;
        atomic64_t s_resv_clusters;
@@@ -1681,34 -1694,6 +1681,34 @@@ static inline int ext4_valid_inum(struc
        _v;                                                                \
  })
  
 +/*
 + * run-time mount flags
 + */
 +enum {
 +      EXT4_MF_MNTDIR_SAMPLED,
 +      EXT4_MF_FS_ABORTED,     /* Fatal error detected */
 +      EXT4_MF_FC_INELIGIBLE,  /* Fast commit ineligible */
 +      EXT4_MF_FC_COMMITTING   /* File system underoing a fast
 +                               * commit.
 +                               */
 +};
 +
 +static inline void ext4_set_mount_flag(struct super_block *sb, int bit)
 +{
 +      set_bit(bit, &EXT4_SB(sb)->s_mount_flags);
 +}
 +
 +static inline void ext4_clear_mount_flag(struct super_block *sb, int bit)
 +{
 +      clear_bit(bit, &EXT4_SB(sb)->s_mount_flags);
 +}
 +
 +static inline int ext4_test_mount_flag(struct super_block *sb, int bit)
 +{
 +      return test_bit(bit, &EXT4_SB(sb)->s_mount_flags);
 +}
 +
 +
  /*
   * Simulate_fail codes
   */
@@@ -1878,13 -1863,6 +1878,13 @@@ static inline bool ext4_verity_in_progr
  #define EXT4_FEATURE_COMPAT_RESIZE_INODE      0x0010
  #define EXT4_FEATURE_COMPAT_DIR_INDEX         0x0020
  #define EXT4_FEATURE_COMPAT_SPARSE_SUPER2     0x0200
 +/*
 + * The reason why "FAST_COMMIT" is a compat feature is that, FS becomes
 + * incompatible only if fast commit blocks are present in the FS. Since we
 + * clear the journal (and thus the fast commit blocks), we don't mark FS as
 + * incompatible. We also have a JBD2 incompat feature, which gets set when
 + * there are fast commit blocks present in the journal.
 + */
  #define EXT4_FEATURE_COMPAT_FAST_COMMIT               0x0400
  #define EXT4_FEATURE_COMPAT_STABLE_INODES     0x0800
  
@@@ -2695,8 -2673,7 +2695,8 @@@ void ext4_insert_dentry(struct inode *i
                        struct ext4_filename *fname);
  static inline void ext4_update_dx_flag(struct inode *inode)
  {
 -      if (!ext4_has_feature_dir_index(inode->i_sb)) {
 +      if (!ext4_has_feature_dir_index(inode->i_sb) &&
 +          ext4_test_inode_flag(inode, EXT4_INODE_INDEX)) {
                /* ext4_iget() should have caught this... */
                WARN_ON_ONCE(ext4_has_feature_metadata_csum(inode->i_sb));
                ext4_clear_inode_flag(inode, EXT4_INODE_INDEX);
@@@ -2754,16 -2731,12 +2754,16 @@@ extern void ext4_end_bitmap_read(struc
  int ext4_fc_info_show(struct seq_file *seq, void *v);
  void ext4_fc_init(struct super_block *sb, journal_t *journal);
  void ext4_fc_init_inode(struct inode *inode);
 -void ext4_fc_track_range(struct inode *inode, ext4_lblk_t start,
 +void ext4_fc_track_range(handle_t *handle, struct inode *inode, ext4_lblk_t start,
                         ext4_lblk_t end);
 -void ext4_fc_track_unlink(struct inode *inode, struct dentry *dentry);
 -void ext4_fc_track_link(struct inode *inode, struct dentry *dentry);
 -void ext4_fc_track_create(struct inode *inode, struct dentry *dentry);
 -void ext4_fc_track_inode(struct inode *inode);
 +void __ext4_fc_track_unlink(handle_t *handle, struct inode *inode,
 +      struct dentry *dentry);
 +void __ext4_fc_track_link(handle_t *handle, struct inode *inode,
 +      struct dentry *dentry);
 +void ext4_fc_track_unlink(handle_t *handle, struct dentry *dentry);
 +void ext4_fc_track_link(handle_t *handle, struct dentry *dentry);
 +void ext4_fc_track_create(handle_t *handle, struct dentry *dentry);
 +void ext4_fc_track_inode(handle_t *handle, struct inode *inode);
  void ext4_fc_mark_ineligible(struct super_block *sb, int reason);
  void ext4_fc_start_ineligible(struct super_block *sb, int reason);
  void ext4_fc_stop_ineligible(struct super_block *sb);
@@@ -3381,10 -3354,6 +3381,6 @@@ static inline void ext4_unlock_group(st
  /* dir.c */
  extern const struct file_operations ext4_dir_operations;
  
- #ifdef CONFIG_UNICODE
- extern const struct dentry_operations ext4_dentry_ops;
- #endif
  /* file.c */
  extern const struct inode_operations ext4_file_inode_operations;
  extern const struct file_operations ext4_file_operations;
@@@ -3479,7 -3448,7 +3475,7 @@@ extern int ext4_handle_dirty_dirblock(h
  extern int ext4_ci_compare(const struct inode *parent,
                           const struct qstr *fname,
                           const struct qstr *entry, bool quick);
 -extern int __ext4_unlink(struct inode *dir, const struct qstr *d_name,
 +extern int __ext4_unlink(handle_t *handle, struct inode *dir, const struct qstr *d_name,
                         struct inode *inode);
  extern int __ext4_link(struct inode *dir, struct inode *inode,
                       struct dentry *dentry);
diff --combined fs/ext4/namei.c
index 5fa8436cd5faee7e3fd29ed652553996c0b44a0b,8e2398e5d0fed60bfc759656ae219cf4f575f5f3..326fe402e495be51ea853be0a85a217b17128bb7
@@@ -643,7 -643,13 +643,7 @@@ static struct stats dx_show_leaf(struc
  
                                name  = de->name;
                                len = de->name_len;
 -                              if (IS_ENCRYPTED(dir))
 -                                      res = fscrypt_get_encryption_info(dir);
 -                              if (res) {
 -                                      printk(KERN_WARNING "Error setting up"
 -                                             " fname crypto: %d\n", res);
 -                              }
 -                              if (!fscrypt_has_encryption_key(dir)) {
 +                              if (!IS_ENCRYPTED(dir)) {
                                        /* Directory is not encrypted */
                                        ext4fs_dirhash(dir, de->name,
                                                de->name_len, &h);
@@@ -1004,7 -1010,7 +1004,7 @@@ static int htree_dirblock_to_tree(struc
                                           EXT4_DIR_REC_LEN(0));
        /* Check if the directory is encrypted */
        if (IS_ENCRYPTED(dir)) {
 -              err = fscrypt_get_encryption_info(dir);
 +              err = fscrypt_prepare_readdir(dir);
                if (err < 0) {
                        brelse(bh);
                        return err;
@@@ -1608,6 -1614,7 +1608,7 @@@ static struct buffer_head *ext4_lookup_
        struct buffer_head *bh;
  
        err = ext4_fname_prepare_lookup(dir, dentry, &fname);
+       generic_set_encrypted_ci_d_ops(dentry);
        if (err == -ENOENT)
                return NULL;
        if (err)
@@@ -2189,9 -2196,6 +2190,9 @@@ static int ext4_add_entry(handle_t *han
        if (!dentry->d_name.len)
                return -EINVAL;
  
 +      if (fscrypt_is_nokey_name(dentry))
 +              return -ENOKEY;
 +
  #ifdef CONFIG_UNICODE
        if (sb_has_strict_encoding(sb) && IS_CASEFOLDED(dir) &&
            sb->s_encoding && utf8_validate(sb->s_encoding, &dentry->d_name))
@@@ -2603,7 -2607,7 +2604,7 @@@ static int ext4_create(struct inode *di
                       bool excl)
  {
        handle_t *handle;
 -      struct inode *inode, *inode_save;
 +      struct inode *inode;
        int err, credits, retries = 0;
  
        err = dquot_initialize(dir);
@@@ -2621,9 -2625,11 +2622,9 @@@ retry
                inode->i_op = &ext4_file_inode_operations;
                inode->i_fop = &ext4_file_operations;
                ext4_set_aops(inode);
 -              inode_save = inode;
 -              ihold(inode_save);
                err = ext4_add_nondir(handle, dentry, &inode);
 -              ext4_fc_track_create(inode_save, dentry);
 -              iput(inode_save);
 +              if (!err)
 +                      ext4_fc_track_create(handle, dentry);
        }
        if (handle)
                ext4_journal_stop(handle);
@@@ -2638,7 -2644,7 +2639,7 @@@ static int ext4_mknod(struct inode *dir
                      umode_t mode, dev_t rdev)
  {
        handle_t *handle;
 -      struct inode *inode, *inode_save;
 +      struct inode *inode;
        int err, credits, retries = 0;
  
        err = dquot_initialize(dir);
@@@ -2655,9 -2661,12 +2656,9 @@@ retry
        if (!IS_ERR(inode)) {
                init_special_inode(inode, inode->i_mode, rdev);
                inode->i_op = &ext4_special_inode_operations;
 -              inode_save = inode;
 -              ihold(inode_save);
                err = ext4_add_nondir(handle, dentry, &inode);
                if (!err)
 -                      ext4_fc_track_create(inode_save, dentry);
 -              iput(inode_save);
 +                      ext4_fc_track_create(handle, dentry);
        }
        if (handle)
                ext4_journal_stop(handle);
@@@ -2821,6 -2830,7 +2822,6 @@@ out_clear_inode
                iput(inode);
                goto out_retry;
        }
 -      ext4_fc_track_create(inode, dentry);
        ext4_inc_count(dir);
  
        ext4_update_dx_flag(dir);
        if (err)
                goto out_clear_inode;
        d_instantiate_new(dentry, inode);
 +      ext4_fc_track_create(handle, dentry);
        if (IS_DIRSYNC(dir))
                ext4_handle_sync(handle);
  
@@@ -3163,7 -3172,7 +3164,7 @@@ static int ext4_rmdir(struct inode *dir
                goto end_rmdir;
        ext4_dec_count(dir);
        ext4_update_dx_flag(dir);
 -      ext4_fc_track_unlink(inode, dentry);
 +      ext4_fc_track_unlink(handle, dentry);
        retval = ext4_mark_inode_dirty(handle, dir);
  
  #ifdef CONFIG_UNICODE
@@@ -3184,12 -3193,13 +3185,12 @@@ end_rmdir
        return retval;
  }
  
 -int __ext4_unlink(struct inode *dir, const struct qstr *d_name,
 +int __ext4_unlink(handle_t *handle, struct inode *dir, const struct qstr *d_name,
                  struct inode *inode)
  {
        int retval = -ENOENT;
        struct buffer_head *bh;
        struct ext4_dir_entry_2 *de;
 -      handle_t *handle = NULL;
        int skip_remove_dentry = 0;
  
        bh = ext4_find_entry(dir, d_name, &de, NULL);
                if (EXT4_SB(inode->i_sb)->s_mount_state & EXT4_FC_REPLAY)
                        skip_remove_dentry = 1;
                else
 -                      goto out_bh;
 -      }
 -
 -      handle = ext4_journal_start(dir, EXT4_HT_DIR,
 -                                  EXT4_DATA_TRANS_BLOCKS(dir->i_sb));
 -      if (IS_ERR(handle)) {
 -              retval = PTR_ERR(handle);
 -              goto out_bh;
 +                      goto out;
        }
  
        if (IS_DIRSYNC(dir))
        if (!skip_remove_dentry) {
                retval = ext4_delete_entry(handle, dir, de, bh);
                if (retval)
 -                      goto out_handle;
 +                      goto out;
                dir->i_ctime = dir->i_mtime = current_time(dir);
                ext4_update_dx_flag(dir);
                retval = ext4_mark_inode_dirty(handle, dir);
                if (retval)
 -                      goto out_handle;
 +                      goto out;
        } else {
                retval = 0;
        }
        inode->i_ctime = current_time(inode);
        retval = ext4_mark_inode_dirty(handle, inode);
  
 -out_handle:
 -      ext4_journal_stop(handle);
 -out_bh:
 +out:
        brelse(bh);
        return retval;
  }
  
  static int ext4_unlink(struct inode *dir, struct dentry *dentry)
  {
 +      handle_t *handle;
        int retval;
  
        if (unlikely(ext4_forced_shutdown(EXT4_SB(dir->i_sb))))
        if (retval)
                goto out_trace;
  
 -      retval = __ext4_unlink(dir, &dentry->d_name, d_inode(dentry));
 +      handle = ext4_journal_start(dir, EXT4_HT_DIR,
 +                                  EXT4_DATA_TRANS_BLOCKS(dir->i_sb));
 +      if (IS_ERR(handle)) {
 +              retval = PTR_ERR(handle);
 +              goto out_trace;
 +      }
 +
 +      retval = __ext4_unlink(handle, dir, &dentry->d_name, d_inode(dentry));
        if (!retval)
 -              ext4_fc_track_unlink(d_inode(dentry), dentry);
 +              ext4_fc_track_unlink(handle, dentry);
  #ifdef CONFIG_UNICODE
        /* VFS negative dentries are incompatible with Encoding and
         * Case-insensitiveness. Eventually we'll want avoid
        if (IS_CASEFOLDED(dir))
                d_invalidate(dentry);
  #endif
 +      if (handle)
 +              ext4_journal_stop(handle);
  
  out_trace:
        trace_ext4_unlink_exit(dentry, retval);
@@@ -3439,6 -3448,7 +3440,6 @@@ retry
  
        err = ext4_add_entry(handle, dentry, inode);
        if (!err) {
 -              ext4_fc_track_link(inode, dentry);
                err = ext4_mark_inode_dirty(handle, inode);
                /* this can happen only for tmpfile being
                 * linked the first time
                if (inode->i_nlink == 1)
                        ext4_orphan_del(handle, inode);
                d_instantiate(dentry, inode);
 +              ext4_fc_track_link(handle, dentry);
        } else {
                drop_nlink(inode);
                iput(inode);
@@@ -3907,9 -3916,9 +3908,9 @@@ static int ext4_rename(struct inode *ol
                        EXT4_FC_REASON_RENAME_DIR);
        } else {
                if (new.inode)
 -                      ext4_fc_track_unlink(new.inode, new.dentry);
 -              ext4_fc_track_link(old.inode, new.dentry);
 -              ext4_fc_track_unlink(old.inode, old.dentry);
 +                      ext4_fc_track_unlink(handle, new.dentry);
 +              __ext4_fc_track_link(handle, old.inode, new.dentry);
 +              __ext4_fc_track_unlink(handle, old.inode, old.dentry);
        }
  
        if (new.inode) {
diff --combined fs/ext4/super.c
index a2ec60fa881112958e219fd04e06b6531d73cc72,82b365acedf8df7d872c19dc5b94a5f7474caf04..830c196ec0691b317be890d331e12b9c20d10a83
@@@ -289,7 -289,18 +289,7 @@@ void ext4_superblock_csum_set(struct su
        if (!ext4_has_metadata_csum(sb))
                return;
  
 -      /*
 -       * Locking the superblock prevents the scenario
 -       * where:
 -       *  1) a first thread pauses during checksum calculation.
 -       *  2) a second thread updates the superblock, recalculates
 -       *     the checksum, and updates s_checksum
 -       *  3) the first thread resumes and finishes its checksum calculation
 -       *     and updates s_checksum with a potentially stale or torn value.
 -       */
 -      lock_buffer(EXT4_SB(sb)->s_sbh);
        es->s_checksum = ext4_superblock_csum(sb, es);
 -      unlock_buffer(EXT4_SB(sb)->s_sbh);
  }
  
  ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
@@@ -675,7 -686,7 +675,7 @@@ static void ext4_handle_error(struct su
        if (!test_opt(sb, ERRORS_CONT)) {
                journal_t *journal = EXT4_SB(sb)->s_journal;
  
 -              EXT4_SB(sb)->s_mount_flags |= EXT4_MF_FS_ABORTED;
 +              ext4_set_mount_flag(sb, EXT4_MF_FS_ABORTED);
                if (journal)
                        jbd2_journal_abort(journal, -EIO);
        }
@@@ -893,7 -904,7 +893,7 @@@ void __ext4_abort(struct super_block *s
        va_end(args);
  
        if (sb_rdonly(sb) == 0) {
 -              EXT4_SB(sb)->s_mount_flags |= EXT4_MF_FS_ABORTED;
 +              ext4_set_mount_flag(sb, EXT4_MF_FS_ABORTED);
                if (EXT4_SB(sb)->s_journal)
                        jbd2_journal_abort(EXT4_SB(sb)->s_journal, -EIO);
  
@@@ -1705,10 -1716,11 +1705,10 @@@ enum 
        Opt_dioread_nolock, Opt_dioread_lock,
        Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable,
        Opt_max_dir_size_kb, Opt_nojournal_checksum, Opt_nombcache,
 -      Opt_prefetch_block_bitmaps, Opt_no_fc,
 +      Opt_prefetch_block_bitmaps,
  #ifdef CONFIG_EXT4_DEBUG
 -      Opt_fc_debug_max_replay,
 +      Opt_fc_debug_max_replay, Opt_fc_debug_force
  #endif
 -      Opt_fc_debug_force
  };
  
  static const match_table_t tokens = {
        {Opt_init_itable, "init_itable=%u"},
        {Opt_init_itable, "init_itable"},
        {Opt_noinit_itable, "noinit_itable"},
 -      {Opt_no_fc, "no_fc"},
 -      {Opt_fc_debug_force, "fc_debug_force"},
  #ifdef CONFIG_EXT4_DEBUG
 +      {Opt_fc_debug_force, "fc_debug_force"},
        {Opt_fc_debug_max_replay, "fc_debug_max_replay=%u"},
  #endif
        {Opt_max_dir_size_kb, "max_dir_size_kb=%u"},
@@@ -2014,8 -2027,8 +2014,8 @@@ static const struct mount_opts 
        {Opt_noquota, (EXT4_MOUNT_QUOTA | EXT4_MOUNT_USRQUOTA |
                       EXT4_MOUNT_GRPQUOTA | EXT4_MOUNT_PRJQUOTA),
                                                        MOPT_CLEAR | MOPT_Q},
 -      {Opt_usrjquota, 0, MOPT_Q},
 -      {Opt_grpjquota, 0, MOPT_Q},
 +      {Opt_usrjquota, 0, MOPT_Q | MOPT_STRING},
 +      {Opt_grpjquota, 0, MOPT_Q | MOPT_STRING},
        {Opt_offusrjquota, 0, MOPT_Q},
        {Opt_offgrpjquota, 0, MOPT_Q},
        {Opt_jqfmt_vfsold, QFMT_VFS_OLD, MOPT_QFMT},
        {Opt_nombcache, EXT4_MOUNT_NO_MBCACHE, MOPT_SET},
        {Opt_prefetch_block_bitmaps, EXT4_MOUNT_PREFETCH_BLOCK_BITMAPS,
         MOPT_SET},
 -      {Opt_no_fc, EXT4_MOUNT2_JOURNAL_FAST_COMMIT,
 -       MOPT_CLEAR | MOPT_2 | MOPT_EXT4_ONLY},
 +#ifdef CONFIG_EXT4_DEBUG
        {Opt_fc_debug_force, EXT4_MOUNT2_JOURNAL_FAST_COMMIT,
         MOPT_SET | MOPT_2 | MOPT_EXT4_ONLY},
 -#ifdef CONFIG_EXT4_DEBUG
        {Opt_fc_debug_max_replay, 0, MOPT_GTE0},
  #endif
        {Opt_err, 0, 0}
@@@ -2138,7 -2153,7 +2138,7 @@@ static int handle_mount_opt(struct supe
                ext4_msg(sb, KERN_WARNING, "Ignoring removed %s option", opt);
                return 1;
        case Opt_abort:
 -              sbi->s_mount_flags |= EXT4_MF_FS_ABORTED;
 +              ext4_set_mount_flag(sb, EXT4_MF_FS_ABORTED);
                return 1;
        case Opt_i_version:
                sb->s_flags |= SB_I_VERSION;
@@@ -2638,6 -2653,10 +2638,6 @@@ static int _ext4_show_options(struct se
        } else if (test_opt2(sb, DAX_INODE)) {
                SEQ_OPTS_PUTS("dax=inode");
        }
 -
 -      if (test_opt2(sb, JOURNAL_FAST_COMMIT))
 -              SEQ_OPTS_PUTS("fast_commit");
 -
        ext4_show_quota_options(seq, sb);
        return 0;
  }
@@@ -3957,7 -3976,7 +3957,7 @@@ int ext4_calculate_overhead(struct supe
         * loaded or not
         */
        if (sbi->s_journal && !sbi->s_journal_bdev)
 -              overhead += EXT4_NUM_B2C(sbi, sbi->s_journal->j_maxlen);
 +              overhead += EXT4_NUM_B2C(sbi, sbi->s_journal->j_total_len);
        else if (ext4_has_feature_journal(sb) && !sbi->s_journal && j_inum) {
                /* j_inum for internal journal is non-zero */
                j_inode = ext4_get_journal_inode(sb, j_inum);
@@@ -4044,8 -4063,9 +4044,8 @@@ static int ext4_fill_super(struct super
        sbi->s_sb = sb;
        sbi->s_inode_readahead_blks = EXT4_DEF_INODE_READAHEAD_BLKS;
        sbi->s_sb_block = sb_block;
 -      if (sb->s_bdev->bd_part)
 -              sbi->s_sectors_written_start =
 -                      part_stat_read(sb->s_bdev->bd_part, sectors[STAT_WRITE]);
 +      sbi->s_sectors_written_start =
 +              part_stat_read(sb->s_bdev, sectors[STAT_WRITE]);
  
        /* Cleanup superblock name */
        strreplace(sb->s_id, '/', '!');
  #endif
  
        if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
 -              printk_once(KERN_WARNING "EXT4-fs: Warning: mounting with data=journal disables delayed allocation, dioread_nolock, and O_DIRECT support!\n");
 +              printk_once(KERN_WARNING "EXT4-fs: Warning: mounting with data=journal disables delayed allocation, dioread_nolock, O_DIRECT and fast_commit support!\n");
                /* can't mount with both data=journal and dioread_nolock. */
                clear_opt(sb, DIOREAD_NOLOCK);
 +              clear_opt2(sb, JOURNAL_FAST_COMMIT);
                if (test_opt2(sb, EXPLICIT_DELALLOC)) {
                        ext4_msg(sb, KERN_ERR, "can't mount with "
                                 "both data=journal and delalloc");
        INIT_LIST_HEAD(&sbi->s_fc_dentry_q[FC_Q_MAIN]);
        INIT_LIST_HEAD(&sbi->s_fc_dentry_q[FC_Q_STAGING]);
        sbi->s_fc_bytes = 0;
 -      sbi->s_mount_flags &= ~EXT4_MF_FC_INELIGIBLE;
 -      sbi->s_mount_flags &= ~EXT4_MF_FC_COMMITTING;
 +      ext4_clear_mount_flag(sb, EXT4_MF_FC_INELIGIBLE);
 +      ext4_clear_mount_flag(sb, EXT4_MF_FC_COMMITTING);
        spin_lock_init(&sbi->s_fc_lock);
        memset(&sbi->s_fc_stats, 0, sizeof(sbi->s_fc_stats));
        sbi->s_fc_replay_state.fc_regions = NULL;
                goto failed_mount_wq;
        }
  
 +      if (test_opt2(sb, JOURNAL_FAST_COMMIT) &&
 +              !jbd2_journal_set_features(EXT4_SB(sb)->s_journal, 0, 0,
 +                                        JBD2_FEATURE_INCOMPAT_FAST_COMMIT)) {
 +              ext4_msg(sb, KERN_ERR,
 +                      "Failed to set fast commit journal feature");
 +              goto failed_mount_wq;
 +      }
 +
        /* We have now updated the journal if required, so we can
         * validate the data journaling mode. */
        switch (test_opt(sb, DATA_FLAGS)) {
@@@ -4963,11 -4974,6 +4963,6 @@@ no_journal
                goto failed_mount4;
        }
  
- #ifdef CONFIG_UNICODE
-       if (sb->s_encoding)
-               sb->s_d_op = &ext4_dentry_ops;
- #endif
        sb->s_root = d_make_root(root);
        if (!sb->s_root) {
                ext4_msg(sb, KERN_ERR, "get root dentry failed");
@@@ -5504,10 -5510,15 +5499,10 @@@ static int ext4_commit_super(struct sup
         */
        if (!(sb->s_flags & SB_RDONLY))
                ext4_update_tstamp(es, s_wtime);
 -      if (sb->s_bdev->bd_part)
 -              es->s_kbytes_written =
 -                      cpu_to_le64(EXT4_SB(sb)->s_kbytes_written +
 -                          ((part_stat_read(sb->s_bdev->bd_part,
 -                                           sectors[STAT_WRITE]) -
 -                            EXT4_SB(sb)->s_sectors_written_start) >> 1));
 -      else
 -              es->s_kbytes_written =
 -                      cpu_to_le64(EXT4_SB(sb)->s_kbytes_written);
 +      es->s_kbytes_written =
 +              cpu_to_le64(EXT4_SB(sb)->s_kbytes_written +
 +                  ((part_stat_read(sb->s_bdev, sectors[STAT_WRITE]) -
 +                    EXT4_SB(sb)->s_sectors_written_start) >> 1));
        if (percpu_counter_initialized(&EXT4_SB(sb)->s_freeclusters_counter))
                ext4_free_blocks_count_set(es,
                        EXT4_C2B(EXT4_SB(sb), percpu_counter_sum_positive(
@@@ -5856,7 -5867,7 +5851,7 @@@ static int ext4_remount(struct super_bl
                goto restore_opts;
        }
  
 -      if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED)
 +      if (ext4_test_mount_flag(sb, EXT4_MF_FS_ABORTED))
                ext4_abort(sb, EXT4_ERR_ESHUTDOWN, "Abort forced by user");
  
        sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
        }
  
        if ((bool)(*flags & SB_RDONLY) != sb_rdonly(sb)) {
 -              if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED) {
 +              if (ext4_test_mount_flag(sb, EXT4_MF_FS_ABORTED)) {
                        err = -EROFS;
                        goto restore_opts;
                }
@@@ -6544,6 -6555,10 +6539,6 @@@ static ssize_t ext4_quota_write(struct 
        brelse(bh);
  out:
        if (inode->i_size < off + len) {
 -              ext4_fc_track_range(inode,
 -                      (inode->i_size > 0 ? inode->i_size - 1 : 0)
 -                              >> inode->i_sb->s_blocksize_bits,
 -                      (off + len) >> inode->i_sb->s_blocksize_bits);
                i_size_write(inode, off + len);
                EXT4_I(inode)->i_disksize = inode->i_size;
                err2 = ext4_mark_inode_dirty(handle, inode);
diff --combined fs/f2fs/checkpoint.c
index 54a1905af052ccef6c024b681bd0083afae71bb8,617d0f6b0836e23ea358ce851bfec8d7b2ca00f6..897edb7c951a4c0d888f2a24c1afefdb36daf58f
@@@ -37,7 -37,7 +37,7 @@@ void f2fs_stop_checkpoint(struct f2fs_s
  struct page *f2fs_grab_meta_page(struct f2fs_sb_info *sbi, pgoff_t index)
  {
        struct address_space *mapping = META_MAPPING(sbi);
-       struct page *page = NULL;
+       struct page *page;
  repeat:
        page = f2fs_grab_cache_page(mapping, index, false);
        if (!page) {
@@@ -348,13 -348,13 +348,13 @@@ static int f2fs_write_meta_pages(struc
                goto skip_write;
  
        /* if locked failed, cp will flush dirty pages instead */
-       if (!mutex_trylock(&sbi->cp_mutex))
+       if (!down_write_trylock(&sbi->cp_global_sem))
                goto skip_write;
  
        trace_f2fs_writepages(mapping->host, wbc, META);
        diff = nr_pages_to_write(sbi, META, wbc);
        written = f2fs_sync_meta_pages(sbi, META, wbc->nr_to_write, FS_META_IO);
-       mutex_unlock(&sbi->cp_mutex);
+       up_write(&sbi->cp_global_sem);
        wbc->nr_to_write = max((long)0, wbc->nr_to_write - written - diff);
        return 0;
  
@@@ -1385,6 -1385,27 +1385,26 @@@ static void commit_checkpoint(struct f2
        f2fs_submit_merged_write(sbi, META_FLUSH);
  }
  
 -      return bdev->bd_part ?
 -              (u64)part_stat_read(bdev->bd_part, sectors[STAT_WRITE]) : 0;
+ static inline u64 get_sectors_written(struct block_device *bdev)
+ {
++      return (u64)part_stat_read(bdev, sectors[STAT_WRITE]);
+ }
+ u64 f2fs_get_sectors_written(struct f2fs_sb_info *sbi)
+ {
+       if (f2fs_is_multi_device(sbi)) {
+               u64 sectors = 0;
+               int i;
+               for (i = 0; i < sbi->s_ndevs; i++)
+                       sectors += get_sectors_written(FDEV(i).bdev);
+               return sectors;
+       }
+       return get_sectors_written(sbi->sb->s_bdev);
+ }
  static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
  {
        struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
        start_blk += data_sum_blocks;
  
        /* Record write statistics in the hot node summary */
-       kbytes_written = sbi->kbytes_written + BD_PART_WRITTEN(sbi);
+       kbytes_written = sbi->kbytes_written;
+       kbytes_written += (f2fs_get_sectors_written(sbi) -
+                               sbi->sectors_written_start) >> 1;
        seg_i->journal->info.kbytes_written = cpu_to_le64(kbytes_written);
  
        if (__remain_node_summaries(cpc->reason)) {
@@@ -1569,7 -1591,7 +1590,7 @@@ int f2fs_write_checkpoint(struct f2fs_s
                f2fs_warn(sbi, "Start checkpoint disabled!");
        }
        if (cpc->reason != CP_RESIZE)
-               mutex_lock(&sbi->cp_mutex);
+               down_write(&sbi->cp_global_sem);
  
        if (!is_sbi_flag_set(sbi, SBI_IS_DIRTY) &&
                ((cpc->reason & CP_FASTBOOT) || (cpc->reason & CP_SYNC) ||
                        goto out;
                }
  
-               if (NM_I(sbi)->dirty_nat_cnt == 0 &&
+               if (NM_I(sbi)->nat_cnt[DIRTY_NAT] == 0 &&
                                SIT_I(sbi)->dirty_sentries == 0 &&
                                prefree_segments(sbi) == 0) {
                        f2fs_flush_sit_entries(sbi, cpc);
@@@ -1644,7 -1666,7 +1665,7 @@@ stop
        trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "finish checkpoint");
  out:
        if (cpc->reason != CP_RESIZE)
-               mutex_unlock(&sbi->cp_mutex);
+               up_write(&sbi->cp_global_sem);
        return err;
  }
  
diff --combined fs/f2fs/dir.c
index 049500f1e764cb88d2a69c01a2c75278e2f23f08,82b58d1f80eb2d1e3c4d5bd236f2da6ed6e4384f..e6270a867be138a58e7a867c8780e96a3415d165
@@@ -5,6 -5,7 +5,7 @@@
   * Copyright (c) 2012 Samsung Electronics Co., Ltd.
   *             http://www.samsung.com/
   */
+ #include <asm/unaligned.h>
  #include <linux/fs.h>
  #include <linux/f2fs_fs.h>
  #include <linux/sched/signal.h>
@@@ -206,30 -207,55 +207,55 @@@ static struct f2fs_dir_entry *find_in_b
  /*
   * Test whether a case-insensitive directory entry matches the filename
   * being searched for.
+  *
+  * Returns 1 for a match, 0 for no match, and -errno on an error.
   */
- static bool f2fs_match_ci_name(const struct inode *dir, const struct qstr *name,
+ static int f2fs_match_ci_name(const struct inode *dir, const struct qstr *name,
                               const u8 *de_name, u32 de_name_len)
  {
        const struct super_block *sb = dir->i_sb;
        const struct unicode_map *um = sb->s_encoding;
+       struct fscrypt_str decrypted_name = FSTR_INIT(NULL, de_name_len);
        struct qstr entry = QSTR_INIT(de_name, de_name_len);
        int res;
  
+       if (IS_ENCRYPTED(dir)) {
+               const struct fscrypt_str encrypted_name =
+                       FSTR_INIT((u8 *)de_name, de_name_len);
+               if (WARN_ON_ONCE(!fscrypt_has_encryption_key(dir)))
+                       return -EINVAL;
+               decrypted_name.name = kmalloc(de_name_len, GFP_KERNEL);
+               if (!decrypted_name.name)
+                       return -ENOMEM;
+               res = fscrypt_fname_disk_to_usr(dir, 0, 0, &encrypted_name,
+                                               &decrypted_name);
+               if (res < 0)
+                       goto out;
+               entry.name = decrypted_name.name;
+               entry.len = decrypted_name.len;
+       }
        res = utf8_strncasecmp_folded(um, name, &entry);
-       if (res < 0) {
-               /*
-                * In strict mode, ignore invalid names.  In non-strict mode,
-                * fall back to treating them as opaque byte sequences.
-                */
-               if (sb_has_strict_encoding(sb) || name->len != entry.len)
-                       return false;
-               return !memcmp(name->name, entry.name, name->len);
+       /*
+        * In strict mode, ignore invalid names.  In non-strict mode,
+        * fall back to treating them as opaque byte sequences.
+        */
+       if (res < 0 && !sb_has_strict_encoding(sb)) {
+               res = name->len == entry.len &&
+                               memcmp(name->name, entry.name, name->len) == 0;
+       } else {
+               /* utf8_strncasecmp_folded returns 0 on match */
+               res = (res == 0);
        }
-       return res == 0;
+ out:
+       kfree(decrypted_name.name);
+       return res;
  }
  #endif /* CONFIG_UNICODE */
  
- static inline bool f2fs_match_name(const struct inode *dir,
+ static inline int f2fs_match_name(const struct inode *dir,
                                   const struct f2fs_filename *fname,
                                   const u8 *de_name, u32 de_name_len)
  {
@@@ -256,6 -282,7 +282,7 @@@ struct f2fs_dir_entry *f2fs_find_target
        struct f2fs_dir_entry *de;
        unsigned long bit_pos = 0;
        int max_len = 0;
+       int res = 0;
  
        if (max_slots)
                *max_slots = 0;
                        continue;
                }
  
-               if (de->hash_code == fname->hash &&
-                   f2fs_match_name(d->inode, fname, d->filename[bit_pos],
-                                   le16_to_cpu(de->name_len)))
-                       goto found;
+               if (de->hash_code == fname->hash) {
+                       res = f2fs_match_name(d->inode, fname,
+                                             d->filename[bit_pos],
+                                             le16_to_cpu(de->name_len));
+                       if (res < 0)
+                               return ERR_PTR(res);
+                       if (res)
+                               goto found;
+               }
  
                if (max_slots && max_len > *max_slots)
                        *max_slots = max_len;
@@@ -326,7 -358,11 +358,11 @@@ static struct f2fs_dir_entry *find_in_l
                }
  
                de = find_in_block(dir, dentry_page, fname, &max_slots);
-               if (de) {
+               if (IS_ERR(de)) {
+                       *res_page = ERR_CAST(de);
+                       de = NULL;
+                       break;
+               } else if (de) {
                        *res_page = dentry_page;
                        break;
                }
@@@ -448,17 -484,39 +484,39 @@@ void f2fs_set_link(struct inode *dir, s
        f2fs_put_page(page, 1);
  }
  
- static void init_dent_inode(const struct f2fs_filename *fname,
+ static void init_dent_inode(struct inode *dir, struct inode *inode,
+                           const struct f2fs_filename *fname,
                            struct page *ipage)
  {
        struct f2fs_inode *ri;
  
+       if (!fname) /* tmpfile case? */
+               return;
        f2fs_wait_on_page_writeback(ipage, NODE, true, true);
  
        /* copy name info. to this inode page */
        ri = F2FS_INODE(ipage);
        ri->i_namelen = cpu_to_le32(fname->disk_name.len);
        memcpy(ri->i_name, fname->disk_name.name, fname->disk_name.len);
+       if (IS_ENCRYPTED(dir)) {
+               file_set_enc_name(inode);
+               /*
+                * Roll-forward recovery doesn't have encryption keys available,
+                * so it can't compute the dirhash for encrypted+casefolded
+                * filenames.  Append it to i_name if possible.  Else, disable
+                * roll-forward recovery of the dentry (i.e., make fsync'ing the
+                * file force a checkpoint) by setting LOST_PINO.
+                */
+               if (IS_CASEFOLDED(dir)) {
+                       if (fname->disk_name.len + sizeof(f2fs_hash_t) <=
+                           F2FS_NAME_LEN)
+                               put_unaligned(fname->hash, (f2fs_hash_t *)
+                                       &ri->i_name[fname->disk_name.len]);
+                       else
+                               file_lost_pino(inode);
+               }
+       }
        set_page_dirty(ipage);
  }
  
@@@ -541,11 -599,7 +599,7 @@@ struct page *f2fs_init_inode_metadata(s
                        return page;
        }
  
-       if (fname) {
-               init_dent_inode(fname, page);
-               if (IS_ENCRYPTED(dir))
-                       file_set_enc_name(inode);
-       }
+       init_dent_inode(dir, inode, fname, page);
  
        /*
         * This file should be checkpointed during fsync.
@@@ -1022,7 -1076,7 +1076,7 @@@ static int f2fs_readdir(struct file *fi
        int err = 0;
  
        if (IS_ENCRYPTED(inode)) {
 -              err = fscrypt_get_encryption_info(inode);
 +              err = fscrypt_prepare_readdir(inode);
                if (err)
                        goto out;
  
        return err < 0 ? err : 0;
  }
  
 -static int f2fs_dir_open(struct inode *inode, struct file *filp)
 -{
 -      if (IS_ENCRYPTED(inode))
 -              return fscrypt_get_encryption_info(inode) ? -EACCES : 0;
 -      return 0;
 -}
 -
  const struct file_operations f2fs_dir_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_read_dir,
        .iterate_shared = f2fs_readdir,
        .fsync          = f2fs_sync_file,
 -      .open           = f2fs_dir_open,
        .unlocked_ioctl = f2fs_ioctl,
  #ifdef CONFIG_COMPAT
        .compat_ioctl   = f2fs_compat_ioctl,
  #endif
  };
- #ifdef CONFIG_UNICODE
- const struct dentry_operations f2fs_dentry_ops = {
-       .d_hash = generic_ci_d_hash,
-       .d_compare = generic_ci_d_compare,
- };
- #endif
diff --combined fs/f2fs/f2fs.h
index 9f793923dabe9dffd0c9d8844a7c93017a96310c,7364d453783f0e2e439abba47b1ab249e1eed66f..bb11759191dcc9a963953125b362395d2a7cd13d
  #else
  #define f2fs_bug_on(sbi, condition)                                   \
        do {                                                            \
-               if (unlikely(condition)) {                              \
-                       WARN_ON(1);                                     \
+               if (WARN_ON(condition))                                 \
                        set_sbi_flag(sbi, SBI_NEED_FSCK);               \
-               }                                                       \
        } while (0)
  #endif
  
@@@ -147,8 -145,10 +145,10 @@@ struct f2fs_mount_info 
  
        /* For compression */
        unsigned char compress_algorithm;       /* algorithm type */
-       unsigned compress_log_size;             /* cluster log size */
+       unsigned char compress_log_size;        /* cluster log size */
+       bool compress_chksum;                   /* compressed data chksum */
        unsigned char compress_ext_cnt;         /* extension count */
+       int compress_mode;                      /* compression mode */
        unsigned char extensions[COMPRESS_EXT_NUM][F2FS_EXTENSION_LEN]; /* extensions */
  };
  
@@@ -402,85 -402,6 +402,6 @@@ static inline bool __has_cursum_space(s
        return size <= MAX_SIT_JENTRIES(journal);
  }
  
- /*
-  * f2fs-specific ioctl commands
-  */
- #define F2FS_IOCTL_MAGIC              0xf5
- #define F2FS_IOC_START_ATOMIC_WRITE   _IO(F2FS_IOCTL_MAGIC, 1)
- #define F2FS_IOC_COMMIT_ATOMIC_WRITE  _IO(F2FS_IOCTL_MAGIC, 2)
- #define F2FS_IOC_START_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 3)
- #define F2FS_IOC_RELEASE_VOLATILE_WRITE       _IO(F2FS_IOCTL_MAGIC, 4)
- #define F2FS_IOC_ABORT_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 5)
- #define F2FS_IOC_GARBAGE_COLLECT      _IOW(F2FS_IOCTL_MAGIC, 6, __u32)
- #define F2FS_IOC_WRITE_CHECKPOINT     _IO(F2FS_IOCTL_MAGIC, 7)
- #define F2FS_IOC_DEFRAGMENT           _IOWR(F2FS_IOCTL_MAGIC, 8,      \
-                                               struct f2fs_defragment)
- #define F2FS_IOC_MOVE_RANGE           _IOWR(F2FS_IOCTL_MAGIC, 9,      \
-                                               struct f2fs_move_range)
- #define F2FS_IOC_FLUSH_DEVICE         _IOW(F2FS_IOCTL_MAGIC, 10,      \
-                                               struct f2fs_flush_device)
- #define F2FS_IOC_GARBAGE_COLLECT_RANGE        _IOW(F2FS_IOCTL_MAGIC, 11,      \
-                                               struct f2fs_gc_range)
- #define F2FS_IOC_GET_FEATURES         _IOR(F2FS_IOCTL_MAGIC, 12, __u32)
- #define F2FS_IOC_SET_PIN_FILE         _IOW(F2FS_IOCTL_MAGIC, 13, __u32)
- #define F2FS_IOC_GET_PIN_FILE         _IOR(F2FS_IOCTL_MAGIC, 14, __u32)
- #define F2FS_IOC_PRECACHE_EXTENTS     _IO(F2FS_IOCTL_MAGIC, 15)
- #define F2FS_IOC_RESIZE_FS            _IOW(F2FS_IOCTL_MAGIC, 16, __u64)
- #define F2FS_IOC_GET_COMPRESS_BLOCKS  _IOR(F2FS_IOCTL_MAGIC, 17, __u64)
- #define F2FS_IOC_RELEASE_COMPRESS_BLOCKS                              \
-                                       _IOR(F2FS_IOCTL_MAGIC, 18, __u64)
- #define F2FS_IOC_RESERVE_COMPRESS_BLOCKS                              \
-                                       _IOR(F2FS_IOCTL_MAGIC, 19, __u64)
- #define F2FS_IOC_SEC_TRIM_FILE                _IOW(F2FS_IOCTL_MAGIC, 20,      \
-                                               struct f2fs_sectrim_range)
- /*
-  * should be same as XFS_IOC_GOINGDOWN.
-  * Flags for going down operation used by FS_IOC_GOINGDOWN
-  */
- #define F2FS_IOC_SHUTDOWN     _IOR('X', 125, __u32)   /* Shutdown */
- #define F2FS_GOING_DOWN_FULLSYNC      0x0     /* going down with full sync */
- #define F2FS_GOING_DOWN_METASYNC      0x1     /* going down with metadata */
- #define F2FS_GOING_DOWN_NOSYNC                0x2     /* going down */
- #define F2FS_GOING_DOWN_METAFLUSH     0x3     /* going down with meta flush */
- #define F2FS_GOING_DOWN_NEED_FSCK     0x4     /* going down to trigger fsck */
- /*
-  * Flags used by F2FS_IOC_SEC_TRIM_FILE
-  */
- #define F2FS_TRIM_FILE_DISCARD                0x1     /* send discard command */
- #define F2FS_TRIM_FILE_ZEROOUT                0x2     /* zero out */
- #define F2FS_TRIM_FILE_MASK           0x3
- struct f2fs_gc_range {
-       u32 sync;
-       u64 start;
-       u64 len;
- };
- struct f2fs_defragment {
-       u64 start;
-       u64 len;
- };
- struct f2fs_move_range {
-       u32 dst_fd;             /* destination fd */
-       u64 pos_in;             /* start position in src_fd */
-       u64 pos_out;            /* start position in dst_fd */
-       u64 len;                /* size to move */
- };
- struct f2fs_flush_device {
-       u32 dev_num;            /* device number to flush */
-       u32 segments;           /* # of segments to flush */
- };
- struct f2fs_sectrim_range {
-       u64 start;
-       u64 len;
-       u64 flags;
- };
  /* for inline stuff */
  #define DEF_INLINE_RESERVED_SIZE      1
  static inline int get_extra_isize(struct inode *inode);
@@@ -533,9 -454,11 +454,11 @@@ struct f2fs_filename 
  #ifdef CONFIG_UNICODE
        /*
         * For casefolded directories: the casefolded name, but it's left NULL
-        * if the original name is not valid Unicode or if the filesystem is
-        * doing an internal operation where usr_fname is also NULL.  In these
-        * cases we fall back to treating the name as an opaque byte sequence.
+        * if the original name is not valid Unicode, if the directory is both
+        * casefolded and encrypted and its encryption key is unavailable, or if
+        * the filesystem is doing an internal operation where usr_fname is also
+        * NULL.  In all these cases we fall back to treating the name as an
+        * opaque byte sequence.
         */
        struct fscrypt_str cf_name;
  #endif
@@@ -753,7 -676,9 +676,9 @@@ enum 
        FI_ATOMIC_REVOKE_REQUEST, /* request to drop atomic data */
        FI_VERITY_IN_PROGRESS,  /* building fs-verity Merkle tree */
        FI_COMPRESSED_FILE,     /* indicate file's data can be compressed */
+       FI_COMPRESS_CORRUPT,    /* indicate compressed cluster is corrupted */
        FI_MMAP_FILE,           /* indicate file was mmapped */
+       FI_ENABLE_COMPRESS,     /* enable compression in "user" compression mode */
        FI_MAX,                 /* max flag, never be used */
  };
  
@@@ -810,6 -735,7 +735,7 @@@ struct f2fs_inode_info 
        atomic_t i_compr_blocks;                /* # of compressed blocks */
        unsigned char i_compress_algorithm;     /* algorithm type */
        unsigned char i_log_cluster_size;       /* log of cluster size */
+       unsigned short i_compress_flag;         /* compress flag */
        unsigned int i_cluster_size;            /* cluster size */
  };
  
@@@ -894,6 -820,13 +820,13 @@@ enum nid_state 
        MAX_NID_STATE,
  };
  
+ enum nat_state {
+       TOTAL_NAT,
+       DIRTY_NAT,
+       RECLAIMABLE_NAT,
+       MAX_NAT_STATE,
+ };
  struct f2fs_nm_info {
        block_t nat_blkaddr;            /* base disk address of NAT */
        nid_t max_nid;                  /* maximum possible node ids */
        struct rw_semaphore nat_tree_lock;      /* protect nat_tree_lock */
        struct list_head nat_entries;   /* cached nat entry list (clean) */
        spinlock_t nat_list_lock;       /* protect clean nat entry list */
-       unsigned int nat_cnt;           /* the # of cached nat entries */
-       unsigned int dirty_nat_cnt;     /* total num of nat entries in set */
+       unsigned int nat_cnt[MAX_NAT_STATE]; /* the # of cached nat entries */
        unsigned int nat_blocks;        /* # of nat blocks */
  
        /* free node ids management */
@@@ -1320,6 -1252,18 +1252,18 @@@ enum fsync_mode 
        FSYNC_MODE_NOBARRIER,   /* fsync behaves nobarrier based on posix */
  };
  
+ enum {
+       COMPR_MODE_FS,          /*
+                                * automatically compress compression
+                                * enabled files
+                                */
+       COMPR_MODE_USER,        /*
+                                * automatical compression is disabled.
+                                * user can control the file compression
+                                * using ioctls
+                                */
+ };
  /*
   * this value is set in page as a private data which indicate that
   * the page is atomically written, and it is in inmem_pages list.
@@@ -1349,9 -1293,15 +1293,15 @@@ enum compress_algorithm_type 
        COMPRESS_MAX,
  };
  
- #define COMPRESS_DATA_RESERVED_SIZE           5
+ enum compress_flag {
+       COMPRESS_CHKSUM,
+       COMPRESS_MAX_FLAG,
+ };
+ #define COMPRESS_DATA_RESERVED_SIZE           4
  struct compress_data {
        __le32 clen;                    /* compressed data size */
+       __le32 chksum;                  /* compressed data chksum */
        __le32 reserved[COMPRESS_DATA_RESERVED_SIZE];   /* reserved */
        u8 cdata[];                     /* compressed data */
  };
@@@ -1404,6 -1354,7 +1354,7 @@@ struct decompress_io_ctx 
        size_t rlen;                    /* valid data length in rbuf */
        size_t clen;                    /* valid data length in cbuf */
        atomic_t pending_pages;         /* in-flight compressed page count */
+       atomic_t verity_pages;          /* in-flight page count for verity */
        bool failed;                    /* indicate IO error during decompression */
        void *private;                  /* payload buffer for specified decompression algorithm */
        void *private2;                 /* extra payload buffer */
@@@ -1446,7 -1397,7 +1397,7 @@@ struct f2fs_sb_info 
        int cur_cp_pack;                        /* remain current cp pack */
        spinlock_t cp_lock;                     /* for flag in ckpt */
        struct inode *meta_inode;               /* cache meta blocks */
-       struct mutex cp_mutex;                  /* checkpoint procedure lock */
+       struct rw_semaphore cp_global_sem;      /* checkpoint procedure lock */
        struct rw_semaphore cp_rwsem;           /* blocking FS operations */
        struct rw_semaphore node_write;         /* locking node writes */
        struct rw_semaphore node_change;        /* locking node change */
        loff_t max_file_blocks;                 /* max block index of file */
        int dir_level;                          /* directory level */
        int readdir_ra;                         /* readahead inode in readdir */
+       u64 max_io_bytes;                       /* max io bytes to merge IOs */
  
        block_t user_block_count;               /* # of user blocks */
        block_t total_valid_block_count;        /* # of valid blocks */
@@@ -1671,13 -1623,6 +1623,6 @@@ static inline bool f2fs_is_multi_device
        return sbi->s_ndevs > 1;
  }
  
- /* For write statistics. Suppose sector size is 512 bytes,
-  * and the return value is in kbytes. s is of struct f2fs_sb_info.
-  */
- #define BD_PART_WRITTEN(s)                                             \
-       (((u64)part_stat_read((s)->sb->s_bdev, sectors[STAT_WRITE]) -   \
-               (s)->sectors_written_start) >> 1)
  static inline void f2fs_update_time(struct f2fs_sb_info *sbi, int type)
  {
        unsigned long now = jiffies;
@@@ -2477,24 -2422,31 +2422,31 @@@ static inline void *f2fs_kmem_cache_all
        return entry;
  }
  
- static inline bool is_idle(struct f2fs_sb_info *sbi, int type)
+ static inline bool is_inflight_io(struct f2fs_sb_info *sbi, int type)
  {
-       if (sbi->gc_mode == GC_URGENT_HIGH)
-               return true;
        if (get_pages(sbi, F2FS_RD_DATA) || get_pages(sbi, F2FS_RD_NODE) ||
                get_pages(sbi, F2FS_RD_META) || get_pages(sbi, F2FS_WB_DATA) ||
                get_pages(sbi, F2FS_WB_CP_DATA) ||
                get_pages(sbi, F2FS_DIO_READ) ||
                get_pages(sbi, F2FS_DIO_WRITE))
-               return false;
+               return true;
  
        if (type != DISCARD_TIME && SM_I(sbi) && SM_I(sbi)->dcc_info &&
                        atomic_read(&SM_I(sbi)->dcc_info->queued_discard))
-               return false;
+               return true;
  
        if (SM_I(sbi) && SM_I(sbi)->fcc_info &&
                        atomic_read(&SM_I(sbi)->fcc_info->queued_flush))
+               return true;
+       return false;
+ }
+ static inline bool is_idle(struct f2fs_sb_info *sbi, int type)
+ {
+       if (sbi->gc_mode == GC_URGENT_HIGH)
+               return true;
+       if (is_inflight_io(sbi, type))
                return false;
  
        if (sbi->gc_mode == GC_URGENT_LOW &&
@@@ -2829,6 -2781,22 +2781,22 @@@ static inline int f2fs_compressed_file(
                is_inode_flag_set(inode, FI_COMPRESSED_FILE);
  }
  
+ static inline bool f2fs_need_compress_data(struct inode *inode)
+ {
+       int compress_mode = F2FS_OPTION(F2FS_I_SB(inode)).compress_mode;
+       if (!f2fs_compressed_file(inode))
+               return false;
+       if (compress_mode == COMPR_MODE_FS)
+               return true;
+       else if (compress_mode == COMPR_MODE_USER &&
+                       is_inode_flag_set(inode, FI_ENABLE_COMPRESS))
+               return true;
+       return false;
+ }
  static inline unsigned int addrs_per_inode(struct inode *inode)
  {
        unsigned int addrs = CUR_ADDRS_PER_INODE(inode) -
@@@ -3251,8 -3219,6 +3219,8 @@@ bool f2fs_empty_dir(struct inode *dir)
  
  static inline int f2fs_add_link(struct dentry *dentry, struct inode *inode)
  {
 +      if (fscrypt_is_nokey_name(dentry))
 +              return -ENOKEY;
        return f2fs_do_add_link(d_inode(dentry->d_parent), &dentry->d_name,
                                inode, inode->i_ino, inode->i_mode);
  }
@@@ -3445,6 -3411,7 +3413,7 @@@ void f2fs_update_dirty_page(struct inod
  void f2fs_remove_dirty_inode(struct inode *inode);
  int f2fs_sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type);
  void f2fs_wait_on_all_pages(struct f2fs_sb_info *sbi, int type);
+ u64 f2fs_get_sectors_written(struct f2fs_sb_info *sbi);
  int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc);
  void f2fs_init_ino_entry_info(struct f2fs_sb_info *sbi);
  int __init f2fs_create_checkpoint_caches(void);
@@@ -3769,9 -3736,6 +3738,6 @@@ static inline void f2fs_update_sit_info
  #endif
  
  extern const struct file_operations f2fs_dir_operations;
- #ifdef CONFIG_UNICODE
- extern const struct dentry_operations f2fs_dentry_ops;
- #endif
  extern const struct file_operations f2fs_file_operations;
  extern const struct inode_operations f2fs_file_inode_operations;
  extern const struct address_space_operations f2fs_dblock_aops;
@@@ -3963,6 -3927,9 +3929,9 @@@ static inline void set_compress_context
                        F2FS_OPTION(sbi).compress_algorithm;
        F2FS_I(inode)->i_log_cluster_size =
                        F2FS_OPTION(sbi).compress_log_size;
+       F2FS_I(inode)->i_compress_flag =
+                       F2FS_OPTION(sbi).compress_chksum ?
+                               1 << COMPRESS_CHKSUM : 0;
        F2FS_I(inode)->i_cluster_size =
                        1 << F2FS_I(inode)->i_log_cluster_size;
        F2FS_I(inode)->i_flags |= F2FS_COMPR_FL;
diff --combined fs/f2fs/file.c
index a9fc482a0e60a53e239847fd502de995578a3c86,16ea10f2bcf5fd0701c5d8e783754053cb9c04c5..f585545277d775b36824bba05c7de46ea694e07f
@@@ -31,6 -31,7 +31,7 @@@
  #include "gc.h"
  #include "trace.h"
  #include <trace/events/f2fs.h>
+ #include <uapi/linux/f2fs.h>
  
  static vm_fault_t f2fs_filemap_fault(struct vm_fault *vmf)
  {
@@@ -412,9 -413,14 +413,14 @@@ static loff_t f2fs_seek_block(struct fi
                goto fail;
  
        /* handle inline data case */
-       if (f2fs_has_inline_data(inode) && whence == SEEK_HOLE) {
-               data_ofs = isize;
-               goto found;
+       if (f2fs_has_inline_data(inode)) {
+               if (whence == SEEK_HOLE) {
+                       data_ofs = isize;
+                       goto found;
+               } else if (whence == SEEK_DATA) {
+                       data_ofs = offset;
+                       goto found;
+               }
        }
  
        pgofs = (pgoff_t)(offset >> PAGE_SHIFT);
@@@ -2230,12 -2236,16 +2236,12 @@@ static int f2fs_ioc_shutdown(struct fil
  
        switch (in) {
        case F2FS_GOING_DOWN_FULLSYNC:
 -              sb = freeze_bdev(sb->s_bdev);
 -              if (IS_ERR(sb)) {
 -                      ret = PTR_ERR(sb);
 +              ret = freeze_bdev(sb->s_bdev);
 +              if (ret)
                        goto out;
 -              }
 -              if (sb) {
 -                      f2fs_stop_checkpoint(sbi, false);
 -                      set_sbi_flag(sbi, SBI_IS_SHUTDOWN);
 -                      thaw_bdev(sb->s_bdev, sb);
 -              }
 +              f2fs_stop_checkpoint(sbi, false);
 +              set_sbi_flag(sbi, SBI_IS_SHUTDOWN);
 +              thaw_bdev(sb->s_bdev);
                break;
        case F2FS_GOING_DOWN_METASYNC:
                /* do checkpoint only */
        return ret;
  }
  
- static int f2fs_ioc_gc_range(struct file *filp, unsigned long arg)
+ static int __f2fs_ioc_gc_range(struct file *filp, struct f2fs_gc_range *range)
  {
-       struct inode *inode = file_inode(filp);
-       struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
-       struct f2fs_gc_range range;
+       struct f2fs_sb_info *sbi = F2FS_I_SB(file_inode(filp));
        u64 end;
        int ret;
  
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
-       if (copy_from_user(&range, (struct f2fs_gc_range __user *)arg,
-                                                       sizeof(range)))
-               return -EFAULT;
        if (f2fs_readonly(sbi->sb))
                return -EROFS;
  
-       end = range.start + range.len;
-       if (end < range.start || range.start < MAIN_BLKADDR(sbi) ||
+       end = range->start + range->len;
+       if (end < range->start || range->start < MAIN_BLKADDR(sbi) ||
                                        end >= MAX_BLKADDR(sbi))
                return -EINVAL;
  
                return ret;
  
  do_more:
-       if (!range.sync) {
+       if (!range->sync) {
                if (!down_write_trylock(&sbi->gc_lock)) {
                        ret = -EBUSY;
                        goto out;
                down_write(&sbi->gc_lock);
        }
  
-       ret = f2fs_gc(sbi, range.sync, true, GET_SEGNO(sbi, range.start));
+       ret = f2fs_gc(sbi, range->sync, true, GET_SEGNO(sbi, range->start));
        if (ret) {
                if (ret == -EBUSY)
                        ret = -EAGAIN;
                goto out;
        }
-       range.start += BLKS_PER_SEC(sbi);
-       if (range.start <= end)
+       range->start += BLKS_PER_SEC(sbi);
+       if (range->start <= end)
                goto do_more;
  out:
        mnt_drop_write_file(filp);
        return ret;
  }
  
+ static int f2fs_ioc_gc_range(struct file *filp, unsigned long arg)
+ {
+       struct f2fs_gc_range range;
+       if (copy_from_user(&range, (struct f2fs_gc_range __user *)arg,
+                                                       sizeof(range)))
+               return -EFAULT;
+       return __f2fs_ioc_gc_range(filp, &range);
+ }
  static int f2fs_ioc_write_checkpoint(struct file *filp, unsigned long arg)
  {
        struct inode *inode = file_inode(filp);
@@@ -2857,9 -2870,9 +2866,9 @@@ out
        return ret;
  }
  
- static int f2fs_ioc_move_range(struct file *filp, unsigned long arg)
+ static int __f2fs_ioc_move_range(struct file *filp,
+                               struct f2fs_move_range *range)
  {
-       struct f2fs_move_range range;
        struct fd dst;
        int err;
  
                        !(filp->f_mode & FMODE_WRITE))
                return -EBADF;
  
-       if (copy_from_user(&range, (struct f2fs_move_range __user *)arg,
-                                                       sizeof(range)))
-               return -EFAULT;
-       dst = fdget(range.dst_fd);
+       dst = fdget(range->dst_fd);
        if (!dst.file)
                return -EBADF;
  
        if (err)
                goto err_out;
  
-       err = f2fs_move_file_range(filp, range.pos_in, dst.file,
-                                       range.pos_out, range.len);
+       err = f2fs_move_file_range(filp, range->pos_in, dst.file,
+                                       range->pos_out, range->len);
  
        mnt_drop_write_file(filp);
-       if (err)
-               goto err_out;
-       if (copy_to_user((struct f2fs_move_range __user *)arg,
-                                               &range, sizeof(range)))
-               err = -EFAULT;
  err_out:
        fdput(dst);
        return err;
  }
  
+ static int f2fs_ioc_move_range(struct file *filp, unsigned long arg)
+ {
+       struct f2fs_move_range range;
+       if (copy_from_user(&range, (struct f2fs_move_range __user *)arg,
+                                                       sizeof(range)))
+               return -EFAULT;
+       return __f2fs_ioc_move_range(filp, &range);
+ }
  static int f2fs_ioc_flush_device(struct file *filp, unsigned long arg)
  {
        struct inode *inode = file_inode(filp);
        return ret;
  }
  
long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
static int f2fs_ioc_get_compress_option(struct file *filp, unsigned long arg)
  {
-       if (unlikely(f2fs_cp_error(F2FS_I_SB(file_inode(filp)))))
-               return -EIO;
-       if (!f2fs_is_checkpoint_ready(F2FS_I_SB(file_inode(filp))))
-               return -ENOSPC;
+       struct inode *inode = file_inode(filp);
+       struct f2fs_comp_option option;
+       if (!f2fs_sb_has_compression(F2FS_I_SB(inode)))
+               return -EOPNOTSUPP;
+       inode_lock_shared(inode);
+       if (!f2fs_compressed_file(inode)) {
+               inode_unlock_shared(inode);
+               return -ENODATA;
+       }
+       option.algorithm = F2FS_I(inode)->i_compress_algorithm;
+       option.log_cluster_size = F2FS_I(inode)->i_log_cluster_size;
+       inode_unlock_shared(inode);
+       if (copy_to_user((struct f2fs_comp_option __user *)arg, &option,
+                               sizeof(option)))
+               return -EFAULT;
+       return 0;
+ }
+ static int f2fs_ioc_set_compress_option(struct file *filp, unsigned long arg)
+ {
+       struct inode *inode = file_inode(filp);
+       struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
+       struct f2fs_comp_option option;
+       int ret = 0;
  
+       if (!f2fs_sb_has_compression(sbi))
+               return -EOPNOTSUPP;
+       if (!(filp->f_mode & FMODE_WRITE))
+               return -EBADF;
+       if (copy_from_user(&option, (struct f2fs_comp_option __user *)arg,
+                               sizeof(option)))
+               return -EFAULT;
+       if (!f2fs_compressed_file(inode) ||
+                       option.log_cluster_size < MIN_COMPRESS_LOG_SIZE ||
+                       option.log_cluster_size > MAX_COMPRESS_LOG_SIZE ||
+                       option.algorithm >= COMPRESS_MAX)
+               return -EINVAL;
+       file_start_write(filp);
+       inode_lock(inode);
+       if (f2fs_is_mmap_file(inode) || get_dirty_pages(inode)) {
+               ret = -EBUSY;
+               goto out;
+       }
+       if (inode->i_size != 0) {
+               ret = -EFBIG;
+               goto out;
+       }
+       F2FS_I(inode)->i_compress_algorithm = option.algorithm;
+       F2FS_I(inode)->i_log_cluster_size = option.log_cluster_size;
+       F2FS_I(inode)->i_cluster_size = 1 << option.log_cluster_size;
+       f2fs_mark_inode_dirty_sync(inode, true);
+       if (!f2fs_is_compress_backend_ready(inode))
+               f2fs_warn(sbi, "compression algorithm is successfully set, "
+                       "but current kernel doesn't support this algorithm.");
+ out:
+       inode_unlock(inode);
+       file_end_write(filp);
+       return ret;
+ }
+ static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)
+ {
+       DEFINE_READAHEAD(ractl, NULL, inode->i_mapping, page_idx);
+       struct address_space *mapping = inode->i_mapping;
+       struct page *page;
+       pgoff_t redirty_idx = page_idx;
+       int i, page_len = 0, ret = 0;
+       page_cache_ra_unbounded(&ractl, len, 0);
+       for (i = 0; i < len; i++, page_idx++) {
+               page = read_cache_page(mapping, page_idx, NULL, NULL);
+               if (IS_ERR(page)) {
+                       ret = PTR_ERR(page);
+                       break;
+               }
+               page_len++;
+       }
+       for (i = 0; i < page_len; i++, redirty_idx++) {
+               page = find_lock_page(mapping, redirty_idx);
+               if (!page)
+                       ret = -ENOENT;
+               set_page_dirty(page);
+               f2fs_put_page(page, 1);
+               f2fs_put_page(page, 0);
+       }
+       return ret;
+ }
+ static int f2fs_ioc_decompress_file(struct file *filp, unsigned long arg)
+ {
+       struct inode *inode = file_inode(filp);
+       struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
+       struct f2fs_inode_info *fi = F2FS_I(inode);
+       pgoff_t page_idx = 0, last_idx;
+       unsigned int blk_per_seg = sbi->blocks_per_seg;
+       int cluster_size = F2FS_I(inode)->i_cluster_size;
+       int count, ret;
+       if (!f2fs_sb_has_compression(sbi) ||
+                       F2FS_OPTION(sbi).compress_mode != COMPR_MODE_USER)
+               return -EOPNOTSUPP;
+       if (!(filp->f_mode & FMODE_WRITE))
+               return -EBADF;
+       if (!f2fs_compressed_file(inode))
+               return -EINVAL;
+       f2fs_balance_fs(F2FS_I_SB(inode), true);
+       file_start_write(filp);
+       inode_lock(inode);
+       if (!f2fs_is_compress_backend_ready(inode)) {
+               ret = -EOPNOTSUPP;
+               goto out;
+       }
+       if (f2fs_is_mmap_file(inode)) {
+               ret = -EBUSY;
+               goto out;
+       }
+       ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX);
+       if (ret)
+               goto out;
+       if (!atomic_read(&fi->i_compr_blocks))
+               goto out;
+       last_idx = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
+       count = last_idx - page_idx;
+       while (count) {
+               int len = min(cluster_size, count);
+               ret = redirty_blocks(inode, page_idx, len);
+               if (ret < 0)
+                       break;
+               if (get_dirty_pages(inode) >= blk_per_seg)
+                       filemap_fdatawrite(inode->i_mapping);
+               count -= len;
+               page_idx += len;
+       }
+       if (!ret)
+               ret = filemap_write_and_wait_range(inode->i_mapping, 0,
+                                                       LLONG_MAX);
+       if (ret)
+               f2fs_warn(sbi, "%s: The file might be partially decompressed "
+                               "(errno=%d). Please delete the file.\n",
+                               __func__, ret);
+ out:
+       inode_unlock(inode);
+       file_end_write(filp);
+       return ret;
+ }
+ static int f2fs_ioc_compress_file(struct file *filp, unsigned long arg)
+ {
+       struct inode *inode = file_inode(filp);
+       struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
+       pgoff_t page_idx = 0, last_idx;
+       unsigned int blk_per_seg = sbi->blocks_per_seg;
+       int cluster_size = F2FS_I(inode)->i_cluster_size;
+       int count, ret;
+       if (!f2fs_sb_has_compression(sbi) ||
+                       F2FS_OPTION(sbi).compress_mode != COMPR_MODE_USER)
+               return -EOPNOTSUPP;
+       if (!(filp->f_mode & FMODE_WRITE))
+               return -EBADF;
+       if (!f2fs_compressed_file(inode))
+               return -EINVAL;
+       f2fs_balance_fs(F2FS_I_SB(inode), true);
+       file_start_write(filp);
+       inode_lock(inode);
+       if (!f2fs_is_compress_backend_ready(inode)) {
+               ret = -EOPNOTSUPP;
+               goto out;
+       }
+       if (f2fs_is_mmap_file(inode)) {
+               ret = -EBUSY;
+               goto out;
+       }
+       ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX);
+       if (ret)
+               goto out;
+       set_inode_flag(inode, FI_ENABLE_COMPRESS);
+       last_idx = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
+       count = last_idx - page_idx;
+       while (count) {
+               int len = min(cluster_size, count);
+               ret = redirty_blocks(inode, page_idx, len);
+               if (ret < 0)
+                       break;
+               if (get_dirty_pages(inode) >= blk_per_seg)
+                       filemap_fdatawrite(inode->i_mapping);
+               count -= len;
+               page_idx += len;
+       }
+       if (!ret)
+               ret = filemap_write_and_wait_range(inode->i_mapping, 0,
+                                                       LLONG_MAX);
+       clear_inode_flag(inode, FI_ENABLE_COMPRESS);
+       if (ret)
+               f2fs_warn(sbi, "%s: The file might be partially compressed "
+                               "(errno=%d). Please delete the file.\n",
+                               __func__, ret);
+ out:
+       inode_unlock(inode);
+       file_end_write(filp);
+       return ret;
+ }
+ static long __f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+ {
        switch (cmd) {
        case FS_IOC_GETFLAGS:
                return f2fs_ioc_getflags(filp, arg);
                return f2fs_reserve_compress_blocks(filp, arg);
        case F2FS_IOC_SEC_TRIM_FILE:
                return f2fs_sec_trim_file(filp, arg);
+       case F2FS_IOC_GET_COMPRESS_OPTION:
+               return f2fs_ioc_get_compress_option(filp, arg);
+       case F2FS_IOC_SET_COMPRESS_OPTION:
+               return f2fs_ioc_set_compress_option(filp, arg);
+       case F2FS_IOC_DECOMPRESS_FILE:
+               return f2fs_ioc_decompress_file(filp, arg);
+       case F2FS_IOC_COMPRESS_FILE:
+               return f2fs_ioc_compress_file(filp, arg);
        default:
                return -ENOTTY;
        }
  }
  
+ long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+ {
+       if (unlikely(f2fs_cp_error(F2FS_I_SB(file_inode(filp)))))
+               return -EIO;
+       if (!f2fs_is_checkpoint_ready(F2FS_I_SB(file_inode(filp))))
+               return -ENOSPC;
+       return __f2fs_ioctl(filp, cmd, arg);
+ }
  static ssize_t f2fs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
  {
        struct file *file = iocb->ki_filp;
  }
  
  #ifdef CONFIG_COMPAT
+ struct compat_f2fs_gc_range {
+       u32 sync;
+       compat_u64 start;
+       compat_u64 len;
+ };
+ #define F2FS_IOC32_GARBAGE_COLLECT_RANGE      _IOW(F2FS_IOCTL_MAGIC, 11,\
+                                               struct compat_f2fs_gc_range)
+ static int f2fs_compat_ioc_gc_range(struct file *file, unsigned long arg)
+ {
+       struct compat_f2fs_gc_range __user *urange;
+       struct f2fs_gc_range range;
+       int err;
+       urange = compat_ptr(arg);
+       err = get_user(range.sync, &urange->sync);
+       err |= get_user(range.start, &urange->start);
+       err |= get_user(range.len, &urange->len);
+       if (err)
+               return -EFAULT;
+       return __f2fs_ioc_gc_range(file, &range);
+ }
+ struct compat_f2fs_move_range {
+       u32 dst_fd;
+       compat_u64 pos_in;
+       compat_u64 pos_out;
+       compat_u64 len;
+ };
+ #define F2FS_IOC32_MOVE_RANGE         _IOWR(F2FS_IOCTL_MAGIC, 9,      \
+                                       struct compat_f2fs_move_range)
+ static int f2fs_compat_ioc_move_range(struct file *file, unsigned long arg)
+ {
+       struct compat_f2fs_move_range __user *urange;
+       struct f2fs_move_range range;
+       int err;
+       urange = compat_ptr(arg);
+       err = get_user(range.dst_fd, &urange->dst_fd);
+       err |= get_user(range.pos_in, &urange->pos_in);
+       err |= get_user(range.pos_out, &urange->pos_out);
+       err |= get_user(range.len, &urange->len);
+       if (err)
+               return -EFAULT;
+       return __f2fs_ioc_move_range(file, &range);
+ }
  long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
  {
+       if (unlikely(f2fs_cp_error(F2FS_I_SB(file_inode(file)))))
+               return -EIO;
+       if (!f2fs_is_checkpoint_ready(F2FS_I_SB(file_inode(file))))
+               return -ENOSPC;
        switch (cmd) {
        case FS_IOC32_GETFLAGS:
                cmd = FS_IOC_GETFLAGS;
        case FS_IOC32_GETVERSION:
                cmd = FS_IOC_GETVERSION;
                break;
+       case F2FS_IOC32_GARBAGE_COLLECT_RANGE:
+               return f2fs_compat_ioc_gc_range(file, arg);
+       case F2FS_IOC32_MOVE_RANGE:
+               return f2fs_compat_ioc_move_range(file, arg);
        case F2FS_IOC_START_ATOMIC_WRITE:
        case F2FS_IOC_COMMIT_ATOMIC_WRITE:
        case F2FS_IOC_START_VOLATILE_WRITE:
        case FS_IOC_GET_ENCRYPTION_KEY_STATUS:
        case FS_IOC_GET_ENCRYPTION_NONCE:
        case F2FS_IOC_GARBAGE_COLLECT:
-       case F2FS_IOC_GARBAGE_COLLECT_RANGE:
        case F2FS_IOC_WRITE_CHECKPOINT:
        case F2FS_IOC_DEFRAGMENT:
-       case F2FS_IOC_MOVE_RANGE:
        case F2FS_IOC_FLUSH_DEVICE:
        case F2FS_IOC_GET_FEATURES:
        case FS_IOC_FSGETXATTR:
        case F2FS_IOC_RELEASE_COMPRESS_BLOCKS:
        case F2FS_IOC_RESERVE_COMPRESS_BLOCKS:
        case F2FS_IOC_SEC_TRIM_FILE:
+       case F2FS_IOC_GET_COMPRESS_OPTION:
+       case F2FS_IOC_SET_COMPRESS_OPTION:
+       case F2FS_IOC_DECOMPRESS_FILE:
+       case F2FS_IOC_COMPRESS_FILE:
                break;
        default:
                return -ENOIOCTLCMD;
        }
-       return f2fs_ioctl(file, cmd, (unsigned long) compat_ptr(arg));
+       return __f2fs_ioctl(file, cmd, (unsigned long) compat_ptr(arg));
  }
  #endif
  
diff --combined fs/f2fs/super.c
index af9f449da64bac569b2ce77ab1ce258e48c30ef9,e8b94bb14bd8e87f9e8ee311bafa26ec069deff0..b4a07fe62d1a58101e1f896bed40c6f3c28b5b81
@@@ -146,6 -146,8 +146,8 @@@ enum 
        Opt_compress_algorithm,
        Opt_compress_log_size,
        Opt_compress_extension,
+       Opt_compress_chksum,
+       Opt_compress_mode,
        Opt_atgc,
        Opt_err,
  };
@@@ -214,6 -216,8 +216,8 @@@ static match_table_t f2fs_tokens = 
        {Opt_compress_algorithm, "compress_algorithm=%s"},
        {Opt_compress_log_size, "compress_log_size=%u"},
        {Opt_compress_extension, "compress_extension=%s"},
+       {Opt_compress_chksum, "compress_chksum"},
+       {Opt_compress_mode, "compress_mode=%s"},
        {Opt_atgc, "atgc"},
        {Opt_err, NULL},
  };
@@@ -934,10 -938,29 +938,29 @@@ static int parse_options(struct super_b
                        F2FS_OPTION(sbi).compress_ext_cnt++;
                        kfree(name);
                        break;
+               case Opt_compress_chksum:
+                       F2FS_OPTION(sbi).compress_chksum = true;
+                       break;
+               case Opt_compress_mode:
+                       name = match_strdup(&args[0]);
+                       if (!name)
+                               return -ENOMEM;
+                       if (!strcmp(name, "fs")) {
+                               F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
+                       } else if (!strcmp(name, "user")) {
+                               F2FS_OPTION(sbi).compress_mode = COMPR_MODE_USER;
+                       } else {
+                               kfree(name);
+                               return -EINVAL;
+                       }
+                       kfree(name);
+                       break;
  #else
                case Opt_compress_algorithm:
                case Opt_compress_log_size:
                case Opt_compress_extension:
+               case Opt_compress_chksum:
+               case Opt_compress_mode:
                        f2fs_info(sbi, "compression options not supported");
                        break;
  #endif
@@@ -1523,6 -1546,14 +1546,14 @@@ static inline void f2fs_show_compress_o
                seq_printf(seq, ",compress_extension=%s",
                        F2FS_OPTION(sbi).extensions[i]);
        }
+       if (F2FS_OPTION(sbi).compress_chksum)
+               seq_puts(seq, ",compress_chksum");
+       if (F2FS_OPTION(sbi).compress_mode == COMPR_MODE_FS)
+               seq_printf(seq, ",compress_mode=%s", "fs");
+       else if (F2FS_OPTION(sbi).compress_mode == COMPR_MODE_USER)
+               seq_printf(seq, ",compress_mode=%s", "user");
  }
  
  static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
@@@ -1672,6 -1703,7 +1703,7 @@@ static void default_options(struct f2fs
        F2FS_OPTION(sbi).compress_algorithm = COMPRESS_LZ4;
        F2FS_OPTION(sbi).compress_log_size = MIN_COMPRESS_LOG_SIZE;
        F2FS_OPTION(sbi).compress_ext_cnt = 0;
+       F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
        F2FS_OPTION(sbi).bggc_mode = BGGC_MODE_ON;
  
        sbi->sb->s_flags &= ~SB_INLINECRYPT;
@@@ -1904,7 -1936,6 +1936,6 @@@ static int f2fs_remount(struct super_bl
  
        if (*flags & SB_RDONLY ||
                F2FS_OPTION(sbi).whint_mode != org_mount_opt.whint_mode) {
-               writeback_inodes_sb(sb, WB_REASON_SYNC);
                sync_inodes_sb(sb);
  
                set_sbi_flag(sbi, SBI_IS_DIRTY);
@@@ -2744,7 -2775,6 +2775,6 @@@ static int sanity_check_raw_super(struc
        block_t total_sections, blocks_per_seg;
        struct f2fs_super_block *raw_super = (struct f2fs_super_block *)
                                        (bh->b_data + F2FS_SUPER_OFFSET);
-       unsigned int blocksize;
        size_t crc_offset = 0;
        __u32 crc = 0;
  
                }
        }
  
-       /* Currently, support only 4KB page cache size */
-       if (F2FS_BLKSIZE != PAGE_SIZE) {
-               f2fs_info(sbi, "Invalid page_cache_size (%lu), supports only 4KB",
-                         PAGE_SIZE);
-               return -EFSCORRUPTED;
-       }
        /* Currently, support only 4KB block size */
-       blocksize = 1 << le32_to_cpu(raw_super->log_blocksize);
-       if (blocksize != F2FS_BLKSIZE) {
-               f2fs_info(sbi, "Invalid blocksize (%u), supports only 4KB",
-                         blocksize);
+       if (le32_to_cpu(raw_super->log_blocksize) != F2FS_BLKSIZE_BITS) {
+               f2fs_info(sbi, "Invalid log_blocksize (%u), supports only %u",
+                         le32_to_cpu(raw_super->log_blocksize),
+                         F2FS_BLKSIZE_BITS);
                return -EFSCORRUPTED;
        }
  
@@@ -3071,9 -3094,9 +3094,9 @@@ static void init_sb_info(struct f2fs_sb
        sbi->total_node_count =
                (le32_to_cpu(raw_super->segment_count_nat) / 2)
                        * sbi->blocks_per_seg * NAT_ENTRY_PER_BLOCK;
-       sbi->root_ino_num = le32_to_cpu(raw_super->root_ino);
-       sbi->node_ino_num = le32_to_cpu(raw_super->node_ino);
-       sbi->meta_ino_num = le32_to_cpu(raw_super->meta_ino);
+       F2FS_ROOT_INO(sbi) = le32_to_cpu(raw_super->root_ino);
+       F2FS_NODE_INO(sbi) = le32_to_cpu(raw_super->node_ino);
+       F2FS_META_INO(sbi) = le32_to_cpu(raw_super->meta_ino);
        sbi->cur_victim_sec = NULL_SECNO;
        sbi->next_victim_seg[BG_GC] = NULL_SEGNO;
        sbi->next_victim_seg[FG_GC] = NULL_SEGNO;
@@@ -3151,7 -3174,7 +3174,7 @@@ static int f2fs_report_zone_cb(struct b
  static int init_blkz_info(struct f2fs_sb_info *sbi, int devi)
  {
        struct block_device *bdev = FDEV(devi).bdev;
 -      sector_t nr_sectors = bdev->bd_part->nr_sects;
 +      sector_t nr_sectors = bdev_nr_sectors(bdev);
        struct f2fs_report_zones_args rep_zone_arg;
        int ret;
  
@@@ -3399,12 -3422,6 +3422,6 @@@ static int f2fs_setup_casefold(struct f
                struct unicode_map *encoding;
                __u16 encoding_flags;
  
-               if (f2fs_sb_has_encrypt(sbi)) {
-                       f2fs_err(sbi,
-                               "Can't mount with encoding and encryption");
-                       return -EINVAL;
-               }
                if (f2fs_sb_read_encoding(sbi->raw_super, &encoding_info,
                                          &encoding_flags)) {
                        f2fs_err(sbi,
  
                sbi->sb->s_encoding = encoding;
                sbi->sb->s_encoding_flags = encoding_flags;
-               sbi->sb->s_d_op = &f2fs_dentry_ops;
        }
  #else
        if (f2fs_sb_has_casefold(sbi)) {
@@@ -3559,7 -3575,7 +3575,7 @@@ try_onemore
        sbi->valid_super_block = valid_super_block;
        init_rwsem(&sbi->gc_lock);
        mutex_init(&sbi->writepages);
-       mutex_init(&sbi->cp_mutex);
+       init_rwsem(&sbi->cp_global_sem);
        init_rwsem(&sbi->node_write);
        init_rwsem(&sbi->node_change);
  
        }
  
        /* For write statistics */
-       sbi->sectors_written_start =
-               (u64)part_stat_read(sb->s_bdev, sectors[STAT_WRITE]);
+       sbi->sectors_written_start = f2fs_get_sectors_written(sbi);
  
        /* Read accumulated write IO statistics if exists */
        seg_i = CURSEG_I(sbi, CURSEG_HOT_NODE);
@@@ -3916,6 -3931,7 +3931,7 @@@ free_bio_info
  
  #ifdef CONFIG_UNICODE
        utf8_unload(sb->s_encoding);
+       sb->s_encoding = NULL;
  #endif
  free_options:
  #ifdef CONFIG_QUOTA
diff --combined fs/f2fs/sysfs.c
index 24e876e849c51212b827fd7877d829d5facb32e4,989a649cfa8b5397c5bd72ac96be79e499be96ac..30bae57428d100dad46f3db67af1a8f9df007ccb
@@@ -90,16 -90,26 +90,17 @@@ static ssize_t free_segments_show(struc
  static ssize_t lifetime_write_kbytes_show(struct f2fs_attr *a,
                struct f2fs_sb_info *sbi, char *buf)
  {
 -      struct super_block *sb = sbi->sb;
 -
 -      if (!sb->s_bdev->bd_part)
 -              return sprintf(buf, "0\n");
 -
        return sprintf(buf, "%llu\n",
                        (unsigned long long)(sbi->kbytes_written +
-                       BD_PART_WRITTEN(sbi)));
+                       ((f2fs_get_sectors_written(sbi) -
+                               sbi->sectors_written_start) >> 1)));
  }
  
  static ssize_t features_show(struct f2fs_attr *a,
                struct f2fs_sb_info *sbi, char *buf)
  {
 -      struct super_block *sb = sbi->sb;
        int len = 0;
  
 -      if (!sb->s_bdev->bd_part)
 -              return sprintf(buf, "0\n");
 -
        if (f2fs_sb_has_encrypt(sbi))
                len += scnprintf(buf, PAGE_SIZE - len, "%s",
                                                "encryption");
@@@ -557,6 -567,7 +558,7 @@@ F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info
  F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, iostat_enable, iostat_enable);
  F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, iostat_period_ms, iostat_period_ms);
  F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, readdir_ra, readdir_ra);
+ F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, max_io_bytes, max_io_bytes);
  F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, gc_pin_file_thresh, gc_pin_file_threshold);
  F2FS_RW_ATTR(F2FS_SBI, f2fs_super_block, extension_list, extension_list);
  #ifdef CONFIG_F2FS_FAULT_INJECTION
@@@ -641,6 -652,7 +643,7 @@@ static struct attribute *f2fs_attrs[] 
        ATTR_LIST(iostat_enable),
        ATTR_LIST(iostat_period_ms),
        ATTR_LIST(readdir_ra),
+       ATTR_LIST(max_io_bytes),
        ATTR_LIST(gc_pin_file_thresh),
        ATTR_LIST(extension_list),
  #ifdef CONFIG_F2FS_FAULT_INJECTION
diff --combined fs/libfs.c
index 7124c2e8df2f5a5f49451ef8d3bb84c7b8712e80,bac918699022038a1836ae6e265ba59450a0c8b0..d1c3bade9f30dd028cfc109d7fc3f8abf2c846cf
@@@ -959,7 -959,7 +959,7 @@@ ssize_t simple_attr_write(struct file *
                          size_t len, loff_t *ppos)
  {
        struct simple_attr *attr;
 -      u64 val;
 +      unsigned long long val;
        size_t size;
        ssize_t ret;
  
                goto out;
  
        attr->set_buf[size] = '\0';
 -      val = simple_strtoll(attr->set_buf, NULL, 0);
 +      ret = kstrtoull(attr->set_buf, 0, &val);
 +      if (ret)
 +              goto out;
        ret = attr->set(attr->data, val);
        if (ret == 0)
                ret = len; /* on success, claim we got the whole input */
@@@ -1451,4 -1449,74 +1451,74 @@@ int generic_ci_d_hash(const struct dent
        return 0;
  }
  EXPORT_SYMBOL(generic_ci_d_hash);
+ static const struct dentry_operations generic_ci_dentry_ops = {
+       .d_hash = generic_ci_d_hash,
+       .d_compare = generic_ci_d_compare,
+ };
+ #endif
+ #ifdef CONFIG_FS_ENCRYPTION
+ static const struct dentry_operations generic_encrypted_dentry_ops = {
+       .d_revalidate = fscrypt_d_revalidate,
+ };
+ #endif
+ #if defined(CONFIG_FS_ENCRYPTION) && defined(CONFIG_UNICODE)
+ static const struct dentry_operations generic_encrypted_ci_dentry_ops = {
+       .d_hash = generic_ci_d_hash,
+       .d_compare = generic_ci_d_compare,
+       .d_revalidate = fscrypt_d_revalidate,
+ };
+ #endif
+ /**
+  * generic_set_encrypted_ci_d_ops - helper for setting d_ops for given dentry
+  * @dentry:   dentry to set ops on
+  *
+  * Casefolded directories need d_hash and d_compare set, so that the dentries
+  * contained in them are handled case-insensitively.  Note that these operations
+  * are needed on the parent directory rather than on the dentries in it, and
+  * while the casefolding flag can be toggled on and off on an empty directory,
+  * dentry_operations can't be changed later.  As a result, if the filesystem has
+  * casefolding support enabled at all, we have to give all dentries the
+  * casefolding operations even if their inode doesn't have the casefolding flag
+  * currently (and thus the casefolding ops would be no-ops for now).
+  *
+  * Encryption works differently in that the only dentry operation it needs is
+  * d_revalidate, which it only needs on dentries that have the no-key name flag.
+  * The no-key flag can't be set "later", so we don't have to worry about that.
+  *
+  * Finally, to maximize compatibility with overlayfs (which isn't compatible
+  * with certain dentry operations) and to avoid taking an unnecessary
+  * performance hit, we use custom dentry_operations for each possible
+  * combination rather than always installing all operations.
+  */
+ void generic_set_encrypted_ci_d_ops(struct dentry *dentry)
+ {
+ #ifdef CONFIG_FS_ENCRYPTION
+       bool needs_encrypt_ops = dentry->d_flags & DCACHE_NOKEY_NAME;
+ #endif
+ #ifdef CONFIG_UNICODE
+       bool needs_ci_ops = dentry->d_sb->s_encoding;
+ #endif
+ #if defined(CONFIG_FS_ENCRYPTION) && defined(CONFIG_UNICODE)
+       if (needs_encrypt_ops && needs_ci_ops) {
+               d_set_d_op(dentry, &generic_encrypted_ci_dentry_ops);
+               return;
+       }
  #endif
+ #ifdef CONFIG_FS_ENCRYPTION
+       if (needs_encrypt_ops) {
+               d_set_d_op(dentry, &generic_encrypted_dentry_ops);
+               return;
+       }
+ #endif
+ #ifdef CONFIG_UNICODE
+       if (needs_ci_ops) {
+               d_set_d_op(dentry, &generic_ci_dentry_ops);
+               return;
+       }
+ #endif
+ }
+ EXPORT_SYMBOL(generic_set_encrypted_ci_d_ops);
diff --combined fs/ubifs/dir.c
index 1f33a5598b93fef50fedfd982acf0fe4f6c507df,7a920434d741bf816ea5487a65f663fd5949e861..7949d7c9aa8c9960814db0a61e550625d731c0de
@@@ -203,6 -203,7 +203,7 @@@ static struct dentry *ubifs_lookup(stru
        dbg_gen("'%pd' in dir ino %lu", dentry, dir->i_ino);
  
        err = fscrypt_prepare_lookup(dir, dentry, &nm);
+       generic_set_encrypted_ci_d_ops(dentry);
        if (err == -ENOENT)
                return d_splice_alias(NULL, dentry);
        if (err)
@@@ -270,15 -271,6 +271,15 @@@ done
        return d_splice_alias(inode, dentry);
  }
  
 +static int ubifs_prepare_create(struct inode *dir, struct dentry *dentry,
 +                              struct fscrypt_name *nm)
 +{
 +      if (fscrypt_is_nokey_name(dentry))
 +              return -ENOKEY;
 +
 +      return fscrypt_setup_filename(dir, &dentry->d_name, 0, nm);
 +}
 +
  static int ubifs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
                        bool excl)
  {
        if (err)
                return err;
  
 -      err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm);
 +      err = ubifs_prepare_create(dir, dentry, &nm);
        if (err)
                goto out_budg;
  
@@@ -514,7 -506,7 +515,7 @@@ static int ubifs_readdir(struct file *f
                return 0;
  
        if (encrypted) {
 -              err = fscrypt_get_encryption_info(dir);
 +              err = fscrypt_prepare_readdir(dir);
                if (err)
                        return err;
  
@@@ -962,7 -954,7 +963,7 @@@ static int ubifs_mkdir(struct inode *di
        if (err)
                return err;
  
 -      err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm);
 +      err = ubifs_prepare_create(dir, dentry, &nm);
        if (err)
                goto out_budg;
  
@@@ -1047,7 -1039,7 +1048,7 @@@ static int ubifs_mknod(struct inode *di
                return err;
        }
  
 -      err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm);
 +      err = ubifs_prepare_create(dir, dentry, &nm);
        if (err) {
                kfree(dev);
                goto out_budg;
@@@ -1131,7 -1123,7 +1132,7 @@@ static int ubifs_symlink(struct inode *
        if (err)
                return err;
  
 -      err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm);
 +      err = ubifs_prepare_create(dir, dentry, &nm);
        if (err)
                goto out_budg;
  
@@@ -1619,6 -1611,14 +1620,6 @@@ int ubifs_getattr(const struct path *pa
        return 0;
  }
  
 -static int ubifs_dir_open(struct inode *dir, struct file *file)
 -{
 -      if (IS_ENCRYPTED(dir))
 -              return fscrypt_get_encryption_info(dir) ? -EACCES : 0;
 -
 -      return 0;
 -}
 -
  const struct inode_operations ubifs_dir_inode_operations = {
        .lookup      = ubifs_lookup,
        .create      = ubifs_create,
@@@ -1645,6 -1645,7 +1646,6 @@@ const struct file_operations ubifs_dir_
        .iterate_shared = ubifs_readdir,
        .fsync          = ubifs_fsync,
        .unlocked_ioctl = ubifs_ioctl,
 -      .open           = ubifs_dir_open,
  #ifdef CONFIG_COMPAT
        .compat_ioctl   = ubifs_compat_ioctl,
  #endif
diff --combined include/linux/fs.h
index 59bba648147f9c3ce3b90d1cc2e9409e8b3a5ea9,4a25ab4dbd3e986d5378b1921592749586504eec..ad4cf1bae5863ef347fbf2d5a6b0db3b1ce967a6
@@@ -696,6 -696,7 +696,6 @@@ struct inode 
        struct list_head        i_devices;
        union {
                struct pipe_inode_info  *i_pipe;
 -              struct block_device     *i_bdev;
                struct cdev             *i_cdev;
                char                    *i_link;
                unsigned                i_dir_seq;
@@@ -922,7 -923,7 +922,7 @@@ struct file 
        const struct file_operations    *f_op;
  
        /*
 -       * Protects f_ep_links, f_flags.
 +       * Protects f_ep, f_flags.
         * Must not be taken from IRQ context.
         */
        spinlock_t              f_lock;
  
  #ifdef CONFIG_EPOLL
        /* Used by fs/eventpoll.c to link all the hooks to this file */
 -      struct list_head        f_ep_links;
 -      struct list_head        f_tfile_llink;
 +      struct hlist_head       *f_ep;
  #endif /* #ifdef CONFIG_EPOLL */
        struct address_space    *f_mapping;
        errseq_t                f_wb_err;
@@@ -1407,7 -1409,7 +1407,7 @@@ enum 
  
  struct sb_writers {
        int                             frozen;         /* Is sb frozen? */
 -      wait_queue_head_t               wait_unfrozen;  /* for get_super_thawed() */
 +      wait_queue_head_t               wait_unfrozen;  /* wait for thaw */
        struct percpu_rw_semaphore      rw_sem[SB_FREEZE_LEVELS];
  };
  
@@@ -1578,24 -1580,8 +1578,24 @@@ extern struct timespec64 current_time(s
   * Snapshotting support.
   */
  
 -void __sb_end_write(struct super_block *sb, int level);
 -int __sb_start_write(struct super_block *sb, int level, bool wait);
 +/*
 + * These are internal functions, please use sb_start_{write,pagefault,intwrite}
 + * instead.
 + */
 +static inline void __sb_end_write(struct super_block *sb, int level)
 +{
 +      percpu_up_read(sb->s_writers.rw_sem + level-1);
 +}
 +
 +static inline void __sb_start_write(struct super_block *sb, int level)
 +{
 +      percpu_down_read(sb->s_writers.rw_sem + level - 1);
 +}
 +
 +static inline bool __sb_start_write_trylock(struct super_block *sb, int level)
 +{
 +      return percpu_down_read_trylock(sb->s_writers.rw_sem + level - 1);
 +}
  
  #define __sb_writers_acquired(sb, lev)        \
        percpu_rwsem_acquire(&(sb)->s_writers.rw_sem[(lev)-1], 1, _THIS_IP_)
@@@ -1659,12 -1645,12 +1659,12 @@@ static inline void sb_end_intwrite(stru
   */
  static inline void sb_start_write(struct super_block *sb)
  {
 -      __sb_start_write(sb, SB_FREEZE_WRITE, true);
 +      __sb_start_write(sb, SB_FREEZE_WRITE);
  }
  
 -static inline int sb_start_write_trylock(struct super_block *sb)
 +static inline bool sb_start_write_trylock(struct super_block *sb)
  {
 -      return __sb_start_write(sb, SB_FREEZE_WRITE, false);
 +      return __sb_start_write_trylock(sb, SB_FREEZE_WRITE);
  }
  
  /**
   */
  static inline void sb_start_pagefault(struct super_block *sb)
  {
 -      __sb_start_write(sb, SB_FREEZE_PAGEFAULT, true);
 +      __sb_start_write(sb, SB_FREEZE_PAGEFAULT);
  }
  
  /*
   */
  static inline void sb_start_intwrite(struct super_block *sb)
  {
 -      __sb_start_write(sb, SB_FREEZE_FS, true);
 +      __sb_start_write(sb, SB_FREEZE_FS);
  }
  
 -static inline int sb_start_intwrite_trylock(struct super_block *sb)
 +static inline bool sb_start_intwrite_trylock(struct super_block *sb)
  {
 -      return __sb_start_write(sb, SB_FREEZE_FS, false);
 +      return __sb_start_write_trylock(sb, SB_FREEZE_FS);
  }
  
  
@@@ -2770,14 -2756,14 +2770,14 @@@ static inline void file_start_write(str
  {
        if (!S_ISREG(file_inode(file)->i_mode))
                return;
 -      __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true);
 +      sb_start_write(file_inode(file)->i_sb);
  }
  
  static inline bool file_start_write_trylock(struct file *file)
  {
        if (!S_ISREG(file_inode(file)->i_mode))
                return true;
 -      return __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, false);
 +      return sb_start_write_trylock(file_inode(file)->i_sb);
  }
  
  static inline void file_end_write(struct file *file)
@@@ -3130,6 -3116,8 +3130,6 @@@ extern struct file_system_type *get_fil
  extern void put_filesystem(struct file_system_type *fs);
  extern struct file_system_type *get_fs_type(const char *name);
  extern struct super_block *get_super(struct block_device *);
 -extern struct super_block *get_super_thawed(struct block_device *);
 -extern struct super_block *get_super_exclusive_thawed(struct block_device *bdev);
  extern struct super_block *get_active_super(struct block_device *bdev);
  extern void drop_super(struct super_block *sb);
  extern void drop_super_exclusive(struct super_block *sb);
@@@ -3198,6 -3186,7 +3198,7 @@@ extern int generic_ci_d_hash(const stru
  extern int generic_ci_d_compare(const struct dentry *dentry, unsigned int len,
                                const char *str, const struct qstr *name);
  #endif
+ extern void generic_set_encrypted_ci_d_ops(struct dentry *dentry);
  
  #ifdef CONFIG_MIGRATION
  extern int buffer_migrate_page(struct address_space *,
@@@ -3226,7 -3215,7 +3227,7 @@@ static inline bool vma_is_fsdax(struct 
  {
        struct inode *inode;
  
 -      if (!vma->vm_file)
 +      if (!IS_ENABLED(CONFIG_FS_DAX) || !vma->vm_file)
                return false;
        if (!vma_is_dax(vma))
                return false;
diff --combined include/linux/fscrypt.h
index d23156d1ac94912935be4d7d834a4ac2ccbccdc3,e72f80482671161c2f9632a004a12e1faa42f375..2ea1387bb497bda9cf84836699c2a626eded8170
@@@ -75,7 -75,7 +75,7 @@@ struct fscrypt_operations 
  static inline struct fscrypt_info *fscrypt_get_info(const struct inode *inode)
  {
        /*
 -       * Pairs with the cmpxchg_release() in fscrypt_get_encryption_info().
 +       * Pairs with the cmpxchg_release() in fscrypt_setup_encryption_info().
         * I.e., another task may publish ->i_crypt_info concurrently, executing
         * a RELEASE barrier.  We need to use smp_load_acquire() here to safely
         * ACQUIRE the memory the other task published.
@@@ -111,35 -111,6 +111,35 @@@ static inline void fscrypt_handle_d_mov
        dentry->d_flags &= ~DCACHE_NOKEY_NAME;
  }
  
 +/**
 + * fscrypt_is_nokey_name() - test whether a dentry is a no-key name
 + * @dentry: the dentry to check
 + *
 + * This returns true if the dentry is a no-key dentry.  A no-key dentry is a
 + * dentry that was created in an encrypted directory that hasn't had its
 + * encryption key added yet.  Such dentries may be either positive or negative.
 + *
 + * When a filesystem is asked to create a new filename in an encrypted directory
 + * and the new filename's dentry is a no-key dentry, it must fail the operation
 + * with ENOKEY.  This includes ->create(), ->mkdir(), ->mknod(), ->symlink(),
 + * ->rename(), and ->link().  (However, ->rename() and ->link() are already
 + * handled by fscrypt_prepare_rename() and fscrypt_prepare_link().)
 + *
 + * This is necessary because creating a filename requires the directory's
 + * encryption key, but just checking for the key on the directory inode during
 + * the final filesystem operation doesn't guarantee that the key was available
 + * during the preceding dentry lookup.  And the key must have already been
 + * available during the dentry lookup in order for it to have been checked
 + * whether the filename already exists in the directory and for the new file's
 + * dentry not to be invalidated due to it incorrectly having the no-key flag.
 + *
 + * Return: %true if the dentry is a no-key name
 + */
 +static inline bool fscrypt_is_nokey_name(const struct dentry *dentry)
 +{
 +      return dentry->d_flags & DCACHE_NOKEY_NAME;
 +}
 +
  /* crypto.c */
  void fscrypt_enqueue_decrypt_work(struct work_struct *);
  
@@@ -200,6 -171,7 +200,6 @@@ int fscrypt_ioctl_remove_key_all_users(
  int fscrypt_ioctl_get_key_status(struct file *filp, void __user *arg);
  
  /* keysetup.c */
 -int fscrypt_get_encryption_info(struct inode *inode);
  int fscrypt_prepare_new_inode(struct inode *dir, struct inode *inode,
                              bool *encrypt_ret);
  void fscrypt_put_encryption_info(struct inode *inode);
@@@ -241,8 -213,6 +241,8 @@@ int __fscrypt_prepare_rename(struct ino
                             unsigned int flags);
  int __fscrypt_prepare_lookup(struct inode *dir, struct dentry *dentry,
                             struct fscrypt_name *fname);
 +int __fscrypt_prepare_readdir(struct inode *dir);
 +int __fscrypt_prepare_setattr(struct dentry *dentry, struct iattr *attr);
  int fscrypt_prepare_setflags(struct inode *inode,
                             unsigned int oldflags, unsigned int flags);
  int fscrypt_prepare_symlink(struct inode *dir, const char *target,
@@@ -274,11 -244,6 +274,11 @@@ static inline void fscrypt_handle_d_mov
  {
  }
  
 +static inline bool fscrypt_is_nokey_name(const struct dentry *dentry)
 +{
 +      return false;
 +}
 +
  /* crypto.c */
  static inline void fscrypt_enqueue_decrypt_work(struct work_struct *work)
  {
@@@ -407,6 -372,10 +407,6 @@@ static inline int fscrypt_ioctl_get_key
  }
  
  /* keysetup.c */
 -static inline int fscrypt_get_encryption_info(struct inode *inode)
 -{
 -      return -EOPNOTSUPP;
 -}
  
  static inline int fscrypt_prepare_new_inode(struct inode *dir,
                                            struct inode *inode,
@@@ -534,17 -503,6 +534,17 @@@ static inline int __fscrypt_prepare_loo
        return -EOPNOTSUPP;
  }
  
 +static inline int __fscrypt_prepare_readdir(struct inode *dir)
 +{
 +      return -EOPNOTSUPP;
 +}
 +
 +static inline int __fscrypt_prepare_setattr(struct dentry *dentry,
 +                                          struct iattr *attr)
 +{
 +      return -EOPNOTSUPP;
 +}
 +
  static inline int fscrypt_prepare_setflags(struct inode *inode,
                                           unsigned int oldflags,
                                           unsigned int flags)
@@@ -683,6 -641,32 +683,6 @@@ static inline bool fscrypt_has_encrypti
        return fscrypt_get_info(inode) != NULL;
  }
  
 -/**
 - * fscrypt_require_key() - require an inode's encryption key
 - * @inode: the inode we need the key for
 - *
 - * If the inode is encrypted, set up its encryption key if not already done.
 - * Then require that the key be present and return -ENOKEY otherwise.
 - *
 - * No locks are needed, and the key will live as long as the struct inode --- so
 - * it won't go away from under you.
 - *
 - * Return: 0 on success, -ENOKEY if the key is missing, or another -errno code
 - * if a problem occurred while setting up the encryption key.
 - */
 -static inline int fscrypt_require_key(struct inode *inode)
 -{
 -      if (IS_ENCRYPTED(inode)) {
 -              int err = fscrypt_get_encryption_info(inode);
 -
 -              if (err)
 -                      return err;
 -              if (!fscrypt_has_encryption_key(inode))
 -                      return -ENOKEY;
 -      }
 -      return 0;
 -}
 -
  /**
   * fscrypt_prepare_link() - prepare to link an inode into a possibly-encrypted
   *                        directory
   *
   * A new link can only be added to an encrypted directory if the directory's
   * encryption key is available --- since otherwise we'd have no way to encrypt
 - * the filename.  Therefore, we first set up the directory's encryption key (if
 - * not already done) and return an error if it's unavailable.
 + * the filename.
   *
   * We also verify that the link will not violate the constraint that all files
   * in an encrypted directory tree use the same encryption policy.
@@@ -753,12 -738,14 +753,15 @@@ static inline int fscrypt_prepare_renam
   *
   * Prepare for ->lookup() in a directory which may be encrypted by determining
   * the name that will actually be used to search the directory on-disk.  If the
 - * directory's encryption key is available, then the lookup is assumed to be by
 - * plaintext name; otherwise, it is assumed to be by no-key name.
 + * directory's encryption policy is supported by this kernel and its encryption
 + * key is available, then the lookup is assumed to be by plaintext name;
 + * otherwise, it is assumed to be by no-key name.
   *
-  * This also installs a custom ->d_revalidate() method which will invalidate the
-  * dentry if it was created without the key and the key is later added.
+  * This will set DCACHE_NOKEY_NAME on the dentry if the lookup is by no-key
+  * name.  In this case the filesystem must assign the dentry a dentry_operations
+  * which contains fscrypt_d_revalidate (or contains a d_revalidate method that
+  * calls fscrypt_d_revalidate), so that the dentry will be invalidated if the
+  * directory's encryption key is later added.
   *
   * Return: 0 on success; -ENOENT if the directory's key is unavailable but the
   * filename isn't a valid no-key name, so a negative dentry should be created;
@@@ -778,26 -765,6 +781,26 @@@ static inline int fscrypt_prepare_looku
        return 0;
  }
  
 +/**
 + * fscrypt_prepare_readdir() - prepare to read a possibly-encrypted directory
 + * @dir: the directory inode
 + *
 + * If the directory is encrypted and it doesn't already have its encryption key
 + * set up, try to set it up so that the filenames will be listed in plaintext
 + * form rather than in no-key form.
 + *
 + * Return: 0 on success; -errno on error.  Note that the encryption key being
 + *       unavailable is not considered an error.  It is also not an error if
 + *       the encryption policy is unsupported by this kernel; that is treated
 + *       like the key being unavailable, so that files can still be deleted.
 + */
 +static inline int fscrypt_prepare_readdir(struct inode *dir)
 +{
 +      if (IS_ENCRYPTED(dir))
 +              return __fscrypt_prepare_readdir(dir);
 +      return 0;
 +}
 +
  /**
   * fscrypt_prepare_setattr() - prepare to change a possibly-encrypted inode's
   *                           attributes
  static inline int fscrypt_prepare_setattr(struct dentry *dentry,
                                          struct iattr *attr)
  {
 -      if (attr->ia_valid & ATTR_SIZE)
 -              return fscrypt_require_key(d_inode(dentry));
 +      if (IS_ENCRYPTED(d_inode(dentry)))
 +              return __fscrypt_prepare_setattr(dentry, attr);
        return 0;
  }
  
This page took 0.341276 seconds and 4 git commands to generate.