[u-boot PATCH] fs: btrfs: hide 'Cannot lookup file' errors on 'load'
Qu Wenruo
quwenruo.btrfs at gmx.com
Wed Nov 6 05:23:15 CET 2024
在 2024/11/6 11:59, Dominique Martinet 写道:
> Running commands such as 'load mmc 2:1 $addr $path' when path does not
> exists historically do not print any error on filesystems such as ext4
> or fat.
> Changing the root filesystem to btrfs would make existing boot script
> print 'Cannot lookup file xxx' errors, confusing customers wondering if
> there is a problem when the mmc load command was used in a if (for
> example to load boot.scr conditionally)
>
> Make that printf a debug message so it is not displayed by default, like
> it is on other filesystems
>
> Signed-off-by: Dominique Martinet <dominique.martinet at atmark-techno.com>
Reviewed-by: Qu Wenruo <wqu at suse.com>
Since other fses are already not output that error message, we have no
extra reason not to follow them.
Thanks for the fix,
Qu
> ---
> iirc this also used to trip up some test in test/fs but I don't recall
> what.
>
> It might make sense to print that error but I think we ought to be
> coherent and either print it for all fs or none; but if we print it
> we'll need to prepare a new command to test file existence before
> loading it.
>
> Thanks!
>
> fs/btrfs/btrfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c
> index 350cff0cbca0..f3087f690fa4 100644
> --- a/fs/btrfs/btrfs.c
> +++ b/fs/btrfs/btrfs.c
> @@ -193,7 +193,7 @@ int btrfs_size(const char *file, loff_t *size)
> ret = btrfs_lookup_path(fs_info->fs_root, BTRFS_FIRST_FREE_OBJECTID,
> file, &root, &ino, &type, 40);
> if (ret < 0) {
> - printf("Cannot lookup file %s\n", file);
> + debug("Cannot lookup file %s\n", file);
> return ret;
> }
> if (type != BTRFS_FT_REG_FILE) {
More information about the U-Boot
mailing list