[PATCH] fs: fat: allow FS and device to have mismatching sector sizes

Caleb Connolly caleb.connolly at linaro.org
Wed Nov 13 05:49:46 CET 2024


The Qualcomm Robotics RB1 and RB2 boards feature MMC storage provisioned
with a 4k sector size GPT, with factory partitions formatted with
filesystems using 512 byte sector sizes.

Whilst certainly unusual, and really not ideal, this appears to work
fine in practise. So demote this failure condition to a debug log.

Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>
---
 fs/fat/fat.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index e2570e816768..a84ca301cad1 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -645,13 +645,12 @@ static int get_fs_info(fsdata *mydata)
 	mydata->rootdir_sect = mydata->fat_sect + mydata->fatlength * bs.fats;
 
 	mydata->sect_size = get_unaligned_le16(bs.sector_size);
 	mydata->clust_size = bs.cluster_size;
-	if (mydata->sect_size != cur_part_info.blksz) {
-		log_err("FAT sector size mismatch (fs=%u, dev=%lu)\n",
+	if (mydata->sect_size != cur_part_info.blksz)
+		log_debug("FAT sector size mismatch (fs=%u, dev=%lu)\n",
 			mydata->sect_size, cur_part_info.blksz);
-		return -1;
-	}
+
 	if (mydata->clust_size == 0) {
 		log_err("FAT cluster size not set\n");
 		return -1;
 	}
-- 
2.47.0



More information about the U-Boot mailing list