summaryrefslogtreecommitdiffstats
path: root/fs/cramfs
diff options
context:
space:
mode:
authorMaxime Bizon <mbizon@freebox.fr>2019-10-19 15:24:11 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2019-11-23 21:44:49 -0500
commit3e5aeec0e267d4422a4e740ce723549a3098a4d1 (patch)
treee83a41bef7958413989992a1a836166d35b63763 /fs/cramfs
parent762c69685ff7ad5ad7fee0656671e20a0c9c864d (diff)
downloadlinux-stable-3e5aeec0e267d4422a4e740ce723549a3098a4d1.tar.gz
linux-stable-3e5aeec0e267d4422a4e740ce723549a3098a4d1.tar.bz2
linux-stable-3e5aeec0e267d4422a4e740ce723549a3098a4d1.zip
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>
Diffstat (limited to 'fs/cramfs')
-rw-r--r--fs/cramfs/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index d12ea28836a5..2f04024c3588 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -958,8 +958,8 @@ static int cramfs_get_tree(struct fs_context *fc)
if (IS_ENABLED(CONFIG_CRAMFS_MTD)) {
ret = get_tree_mtd(fc, cramfs_mtd_fill_super);
- if (ret < 0)
- return ret;
+ if (!ret)
+ return 0;
}
if (IS_ENABLED(CONFIG_CRAMFS_BLOCKDEV))
ret = get_tree_bdev(fc, cramfs_blkdev_fill_super);