Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

cramfs: fix usage on non-MTD device

When both CONFIG_CRAMFS_MTD and CONFIG_CRAMFS_BLOCKDEV are enabled, if
we fail to mount on MTD, we don't try on block device.

Note: this relies upon cramfs_mtd_fill_super() leaving no side
effects on fc state in case of failure; in general, failing
get_tree_...() does *not* mean "fine to try again"; e.g. parsed
options might've been consumed by fill_super callback and freed
on failure.

Fixes: 74f78fc5ef43 ("vfs: Convert cramfs to use the new mount API")

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

Maxime Bizon and committed by
Al Viro
3e5aeec0 762c6968

+2 -2
+2 -2
fs/cramfs/inode.c
··· 958 958 959 959 if (IS_ENABLED(CONFIG_CRAMFS_MTD)) { 960 960 ret = get_tree_mtd(fc, cramfs_mtd_fill_super); 961 - if (ret < 0) 962 - return ret; 961 + if (!ret) 962 + return 0; 963 963 } 964 964 if (IS_ENABLED(CONFIG_CRAMFS_BLOCKDEV)) 965 965 ret = get_tree_bdev(fc, cramfs_blkdev_fill_super);