• Icenowy Zheng's avatar
    f2fs: use EINVAL for superblock with invalid magic · d55f472d
    Icenowy Zheng authored
    The kernel mount_block_root() function expects -EACESS or -EINVAL for a
    unmountable filesystem when trying to mount the root with different
    filesystem types.
    
    However, in 5.3-rc1 the behavior when F2FS code cannot find valid block
    changed to return -EFSCORRUPTED(-EUCLEAN), and this error code makes
    mount_block_root() fail when trying to probe F2FS.
    
    When the magic number of the superblock mismatches, it has a high
    probability that it's just not a F2FS. In this case return -EINVAL seems
    to be a better result, and this return value can make mount_block_root()
    probing work again.
    
    Return -EINVAL when the superblock has magic mismatch, -EFSCORRUPTED in
    other cases (the magic matches but the superblock cannot be recognized).
    
    Fixes: 10f966bbf521 ("f2fs: use generic EFSBADCRC/EFSCORRUPTED")
    Signed-off-by: 's avatarIcenowy Zheng <icenowy@aosc.io>
    Reviewed-by: 's avatarChao Yu <yuchao0@huawei.com>
    Signed-off-by: 's avatarJaegeuk Kim <jaegeuk@kernel.org>
    d55f472d
Name
Last commit
Last update
Documentation Loading commit data...
android/configs Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
Android.bp Loading commit data...
AndroidKernel.mk Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...
REPORTING-BUGS Loading commit data...
backported-features Loading commit data...
build.config.cuttlefish.aarch64 Loading commit data...
build.config.cuttlefish.x86_64 Loading commit data...
build.config.goldfish.arm Loading commit data...
build.config.goldfish.arm64 Loading commit data...
build.config.goldfish.mips Loading commit data...
build.config.goldfish.mips64 Loading commit data...
build.config.goldfish.x86 Loading commit data...
build.config.goldfish.x86_64 Loading commit data...
verity_dev_keys.x509 Loading commit data...