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

erofs: use get_tree_bdev_flags() to avoid misleading messages

Users can pass in an arbitrary source path for the proper type of
a mount then without "Can't lookup blockdev" error message.

Reported-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
Closes: https://lore.kernel.org/r/CAOYeF9VQ8jKVmpy5Zy9DNhO6xmWSKMB-DO8yvBB0XvBE7=3Ugg@mail.gmail.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20241009033151.2334888-2-hsiangkao@linux.alibaba.com
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Gao Xiang and committed by
Christian Brauner
14c2d972 4021e685

+3 -1
+3 -1
fs/erofs/super.c
··· 709 709 if (IS_ENABLED(CONFIG_EROFS_FS_ONDEMAND) && sbi->fsid) 710 710 return get_tree_nodev(fc, erofs_fc_fill_super); 711 711 712 - ret = get_tree_bdev(fc, erofs_fc_fill_super); 712 + ret = get_tree_bdev_flags(fc, erofs_fc_fill_super, 713 + IS_ENABLED(CONFIG_EROFS_FS_BACKED_BY_FILE) ? 714 + GET_TREE_BDEV_QUIET_LOOKUP : 0); 713 715 #ifdef CONFIG_EROFS_FS_BACKED_BY_FILE 714 716 if (ret == -ENOTBLK) { 715 717 if (!fc->source)