fs: Quieten down the filesystems more
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>
This commit is contained in:
parent
19511935df
commit
f337fb9ea8
4 changed files with 13 additions and 14 deletions
|
@ -264,20 +264,19 @@ int part_get_info_efi(struct blk_desc *dev_desc, int part,
|
||||||
|
|
||||||
/* "part" argument must be at least 1 */
|
/* "part" argument must be at least 1 */
|
||||||
if (part < 1) {
|
if (part < 1) {
|
||||||
printf("%s: Invalid Argument(s)\n", __func__);
|
log_debug("Invalid Argument(s)\n");
|
||||||
return -1;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function validates AND fills in the GPT header and PTE */
|
/* This function validates AND fills in the GPT header and PTE */
|
||||||
if (find_valid_gpt(dev_desc, gpt_head, &gpt_pte) != 1)
|
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) ||
|
if (part > le32_to_cpu(gpt_head->num_partition_entries) ||
|
||||||
!is_pte_valid(&gpt_pte[part - 1])) {
|
!is_pte_valid(&gpt_pte[part - 1])) {
|
||||||
debug("%s: *** ERROR: Invalid partition number %d ***\n",
|
log_debug("*** ERROR: Invalid partition number %d ***\n", part);
|
||||||
__func__, part);
|
|
||||||
free(gpt_pte);
|
free(gpt_pte);
|
||||||
return -1;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The 'lbaint_t' casting may limit the maximum disk size to 2 TB */
|
/* 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);
|
info->type_guid, UUID_STR_FORMAT_GUID);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
debug("%s: start 0x" LBAF ", size 0x" LBAF ", name %s\n", __func__,
|
log_debug("start 0x" LBAF ", size 0x" LBAF ", name %s\n", info->start,
|
||||||
info->start, info->size, info->name);
|
info->size, info->name);
|
||||||
|
|
||||||
/* Remember to free pte */
|
/* Remember to free pte */
|
||||||
free(gpt_pte);
|
free(gpt_pte);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0+
|
// SPDX-License-Identifier: GPL-2.0+
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <fs_internal.h>
|
#include <fs_internal.h>
|
||||||
|
#include <log.h>
|
||||||
#include <uuid.h>
|
#include <uuid.h>
|
||||||
#include <memalign.h>
|
#include <memalign.h>
|
||||||
#include "kernel-shared/btrfs_tree.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,
|
if (round_up(BTRFS_SUPER_INFO_SIZE + BTRFS_SUPER_INFO_OFFSET,
|
||||||
desc->blksz) > (part->size << desc->log2blksz)) {
|
desc->blksz) > (part->size << desc->log2blksz)) {
|
||||||
error("superblock end %u is larger than device size " LBAFU,
|
log_debug("superblock end %u is larger than device size " LBAFU,
|
||||||
BTRFS_SUPER_INFO_SIZE + BTRFS_SUPER_INFO_OFFSET,
|
BTRFS_SUPER_INFO_SIZE + BTRFS_SUPER_INFO_OFFSET,
|
||||||
part->size << desc->log2blksz);
|
part->size << desc->log2blksz);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2415,7 +2415,7 @@ int ext4fs_mount(unsigned part_length)
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
fail:
|
fail:
|
||||||
printf("Failed to mount ext2 filesystem...\n");
|
log_debug("Failed to mount ext2 filesystem...\n");
|
||||||
fail_noerr:
|
fail_noerr:
|
||||||
free(data);
|
free(data);
|
||||||
ext4fs_root = NULL;
|
ext4fs_root = NULL;
|
||||||
|
|
|
@ -29,8 +29,7 @@ int fs_devread(struct blk_desc *blk, struct disk_partition *partition,
|
||||||
/* Check partition boundaries */
|
/* Check partition boundaries */
|
||||||
if ((sector + ((byte_offset + byte_len - 1) >> log2blksz))
|
if ((sector + ((byte_offset + byte_len - 1) >> log2blksz))
|
||||||
>= partition->size) {
|
>= partition->size) {
|
||||||
log_err("%s read outside partition " LBAFU "\n", __func__,
|
log_debug("read outside partition " LBAFU "\n", sector);
|
||||||
sector);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue