From 1c9f8f6412de4447c4f6fadeac1919c89de005f7 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Fri, 21 Jun 2019 15:32:51 +0200 Subject: ext4: fix calculating inode blkcount for non-512 blocksize filesystems The block count entry in the EXT4 filesystem disk structures uses standard 512-bytes units for most of the typical files. The only exception are HUGE files, which use the filesystem block size, but those are not supported by uboot's EXT4 implementation anyway. This patch fixes the EXT4 code to use proper unit count for inode block count. This fixes errors reported by fsck.ext4 on disks with non-standard (i.e. 4KiB, in case of new flash drives) PHYSICAL block size after using 'ext4write' uboot's command. Signed-off-by: Marek Szyprowski Reviewed-by: Lukasz Majewski --- include/ext_common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/ext_common.h') diff --git a/include/ext_common.h b/include/ext_common.h index 17c92f1..1c10c50 100644 --- a/include/ext_common.h +++ b/include/ext_common.h @@ -21,6 +21,7 @@ #define __EXT_COMMON__ #include #define SECTOR_SIZE 0x200 +#define LOG2_SECTOR_SIZE 9 /* Magic value used to identify an ext2 filesystem. */ #define EXT2_MAGIC 0xEF53 -- cgit v1.1