Skip to content

Commit 3e5aeec

Browse files
mbizonfreeboxAl Viro
authored andcommitted
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: 74f78fc ("vfs: Convert cramfs to use the new mount API") Signed-off-by: Maxime Bizon <[email protected]> Signed-off-by: Nicolas Pitre <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 762c696 commit 3e5aeec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/cramfs/inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,8 +958,8 @@ static int cramfs_get_tree(struct fs_context *fc)
958958

959959
if (IS_ENABLED(CONFIG_CRAMFS_MTD)) {
960960
ret = get_tree_mtd(fc, cramfs_mtd_fill_super);
961-
if (ret < 0)
962-
return ret;
961+
if (!ret)
962+
return 0;
963963
}
964964
if (IS_ENABLED(CONFIG_CRAMFS_BLOCKDEV))
965965
ret = get_tree_bdev(fc, cramfs_blkdev_fill_super);

0 commit comments

Comments
 (0)