summaryrefslogtreecommitdiff
path: root/fs/btrfs/btrfs.c
diff options
context:
space:
mode:
authorDominique Martinet <dominique.martinet@atmark-techno.com>2024-11-15 11:15:47 +0900
committerTom Rini <trini@konsulko.com>2024-11-15 13:11:47 -0600
commit6e988fde65b0a89d49c20553d47a8ec1e5461c12 (patch)
tree19f60b95cc061b3e8c2d1ba5f108ca50a970d16c /fs/btrfs/btrfs.c
parent92e1c2bf9ea93c9bd3e6871cc81566bb10dbc017 (diff)
fs: btrfs: hide duplicate 'Cannot lookup file' error on 'load'
Running commands such as 'load mmc 2:1 $addr $path' when path does not exists will print an error twice if the file does not exist, e.g.: ``` Cannot lookup file boot/boot.scr Failed to load 'boot/boot.scr' ``` (where the first line is printed by btrfs and the second by common fs code) Historically other filesystems such as ext4 or fat have not been printing a message here, so do the same here to avoid duplicate. The other error messages in this function are also somewhat redundant, but bring useful diagnostics if they happen somewhere, so have been left as printf. Note that if a user wants no message to be printed for optional file loads, they have to check for file existence first with other commands such as 'size'. Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com> Reviewed-by: Qu Wenruo <wqu@suse.com>
Diffstat (limited to 'fs/btrfs/btrfs.c')
-rw-r--r--fs/btrfs/btrfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c
index 350cff0cbca..f3087f690fa 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) {