]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
fs: Quieten down the filesystems more
authorSimon Glass <sjg@chromium.org>
Tue, 11 Oct 2022 15:47:11 +0000 (09:47 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 18 Oct 2022 03:17:12 +0000 (21:17 -0600)
When looking for a filesystem on a partition we should do so quietly. At
present if the filesystem is very small (e.g. 512 bytes) we get a host of
messages.

Update these to only show when debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
disk/part_efi.c
fs/btrfs/disk-io.c
fs/ext4/ext4_common.c
fs/fs_internal.c

index ad94504ed90d9e24d8340174105ace39682d7881..26738a57d5d477adb67104ed81ec50997c86b603 100644 (file)
@@ -264,20 +264,19 @@ int part_get_info_efi(struct blk_desc *dev_desc, int part,
 
        /* "part" argument must be at least 1 */
        if (part < 1) {
-               printf("%s: Invalid Argument(s)\n", __func__);
-               return -1;
+               log_debug("Invalid Argument(s)\n");
+               return -EINVAL;
        }
 
        /* This function validates AND fills in the GPT header and PTE */
        if (find_valid_gpt(dev_desc, gpt_head, &gpt_pte) != 1)
-               return -1;
+               return -EINVAL;
 
        if (part > le32_to_cpu(gpt_head->num_partition_entries) ||
            !is_pte_valid(&gpt_pte[part - 1])) {
-               debug("%s: *** ERROR: Invalid partition number %d ***\n",
-                       __func__, part);
+               log_debug("*** ERROR: Invalid partition number %d ***\n", part);
                free(gpt_pte);
-               return -1;
+               return -EPERM;
        }
 
        /* The 'lbaint_t' casting may limit the maximum disk size to 2 TB */
@@ -300,8 +299,8 @@ int part_get_info_efi(struct blk_desc *dev_desc, int part,
                        info->type_guid, UUID_STR_FORMAT_GUID);
 #endif
 
-       debug("%s: start 0x" LBAF ", size 0x" LBAF ", name %s\n", __func__,
-             info->start, info->size, info->name);
+       log_debug("start 0x" LBAF ", size 0x" LBAF ", name %s\n", info->start,
+                 info->size, info->name);
 
        /* Remember to free pte */
        free(gpt_pte);
index c80f8e8028341b15418df2eaee9735c61b0223d0..3f0d9f1c113ba33409ac52ef86fabddb789eecd0 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 #include <common.h>
 #include <fs_internal.h>
+#include <log.h>
 #include <uuid.h>
 #include <memalign.h>
 #include "kernel-shared/btrfs_tree.h"
@@ -910,9 +911,9 @@ static int btrfs_scan_fs_devices(struct blk_desc *desc,
 
        if (round_up(BTRFS_SUPER_INFO_SIZE + BTRFS_SUPER_INFO_OFFSET,
                     desc->blksz) > (part->size << desc->log2blksz)) {
-               error("superblock end %u is larger than device size " LBAFU,
-                               BTRFS_SUPER_INFO_SIZE + BTRFS_SUPER_INFO_OFFSET,
-                               part->size << desc->log2blksz);
+               log_debug("superblock end %u is larger than device size " LBAFU,
+                         BTRFS_SUPER_INFO_SIZE + BTRFS_SUPER_INFO_OFFSET,
+                         part->size << desc->log2blksz);
                return -EINVAL;
        }
 
index d49ba4a9954dc4a3837606899e29b81e54739850..1185cb2c0466713ce5fe9df78e6e45df64f36e6b 100644 (file)
@@ -2415,7 +2415,7 @@ int ext4fs_mount(unsigned part_length)
 
        return 1;
 fail:
-       printf("Failed to mount ext2 filesystem...\n");
+       log_debug("Failed to mount ext2 filesystem...\n");
 fail_noerr:
        free(data);
        ext4fs_root = NULL;
index ae1cb8584c743a92a1c020c73f8688dd1bdd0b7a..111f91b355d1ff974d0953944464fc07c48bbe62 100644 (file)
@@ -29,8 +29,7 @@ int fs_devread(struct blk_desc *blk, struct disk_partition *partition,
        /* Check partition boundaries */
        if ((sector + ((byte_offset + byte_len - 1) >> log2blksz))
            >= partition->size) {
-               log_err("%s read outside partition " LBAFU "\n", __func__,
-                       sector);
+               log_debug("read outside partition " LBAFU "\n", sector);
                return 0;
        }