Skip to contentSkip to conversation

image_types: ext4 should always have large inodes

PATCH In review Ross Burton 2 participants 3 messages Jul 16, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image_types: ext4 should always have large inodes

mkfs.ext4 has logic where "small" file systems use "good old" 128-byte inodes instead of the default 256-byte inodes. This means that small filesystems are not 2038-safe as they only support 32-bit timestamps.

However, "small" is defined as "less than 500MB", which is a fair number of filesystems in OpenEmbedded, especially when filesystems may be created small and expanded later.

To avoid a discussion over how small a file system should be before it shouldn't be 2038-safe, simply build all filesystems with the default type so they all have 256-byte inodes and thus 64-bit timestamps.

[ YOCTO #14478 ]

---
 meta/classes/image_types.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/image_types.bbclass +1 -1
index 954d6739ec..3dad86caa7 100644
@@ -90,7 +90,7 @@ oe_mkext234fs () {
 
 IMAGE_CMD_ext2 = "oe_mkext234fs ext2 ${EXTRA_IMAGECMD}"
 IMAGE_CMD_ext3 = "oe_mkext234fs ext3 ${EXTRA_IMAGECMD}"
-IMAGE_CMD_ext4 = "oe_mkext234fs ext4 ${EXTRA_IMAGECMD}"
+IMAGE_CMD_ext4 = "oe_mkext234fs ext4 -T default ${EXTRA_IMAGECMD}"
 
 MIN_BTRFS_SIZE ?= "16384"
 IMAGE_CMD_btrfs () {
Signature · 1 line
2.25.1
#1 lore raw

Hi Ross,

This broke at least non-gpl3:
https://autobuilder.yoctoproject.org/typhoon/#/builders/75/builds/3691/steps/11/logs/stdio

Quoted 39 lines · Ross Burton

mkfs.ext4 has logic where "small" file systems use "good old" 128-byte inodes instead of the default 256-byte inodes. This means that small filesystems are not 2038-safe as they only support 32-bit timestamps.

However, "small" is defined as "less than 500MB", which is a fair number of filesystems in OpenEmbedded, especially when filesystems may be created small and expanded later.

To avoid a discussion over how small a file system should be before it shouldn't be 2038-safe, simply build all filesystems with the default type so they all have 256-byte inodes and thus 64-bit timestamps.

[ YOCTO #14478 ]

---
 meta/classes/image_types.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/image_types.bbclass +1 -1
index 954d6739ec..3dad86caa7 100644
@@ -90,7 +90,7 @@ oe_mkext234fs () {
 
 IMAGE_CMD_ext2 = "oe_mkext234fs ext2 ${EXTRA_IMAGECMD}"
 IMAGE_CMD_ext3 = "oe_mkext234fs ext3 ${EXTRA_IMAGECMD}"
-IMAGE_CMD_ext4 = "oe_mkext234fs ext4 ${EXTRA_IMAGECMD}"
+IMAGE_CMD_ext4 = "oe_mkext234fs ext4 -T default ${EXTRA_IMAGECMD}"
 
 MIN_BTRFS_SIZE ?= "16384"
 IMAGE_CMD_btrfs () {
Signature · 1 line
2.25.1
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

Drop this, a second iteration is now on the list.

Ross

Quoted 52 lines · Alexandre Belloni

Hi Ross,

This broke at least non-gpl3:
https://autobuilder.yoctoproject.org/typhoon/#/builders/75/builds/3691/steps/11/logs/stdio

Quoted 33 lines · Ross Burton

mkfs.ext4 has logic where "small" file systems use "good old" 128-byte inodes instead of the default 256-byte inodes. This means that small filesystems are not 2038-safe as they only support 32-bit timestamps.

However, "small" is defined as "less than 500MB", which is a fair number of filesystems in OpenEmbedded, especially when filesystems may be created small and expanded later.

To avoid a discussion over how small a file system should be before it shouldn't be 2038-safe, simply build all filesystems with the default type so they all have 256-byte inodes and thus 64-bit timestamps.

[ YOCTO #14478 ]

---
 meta/classes/image_types.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/image_types.bbclass +1 -2
index 954d6739ec..3dad86caa7 100644
@@ -90,7 +90,7 @@ oe_mkext234fs () {
 
 IMAGE_CMD_ext2 = "oe_mkext234fs ext2 ${EXTRA_IMAGECMD}"
 IMAGE_CMD_ext3 = "oe_mkext234fs ext3 ${EXTRA_IMAGECMD}"
-IMAGE_CMD_ext4 = "oe_mkext234fs ext4 ${EXTRA_IMAGECMD}"
+IMAGE_CMD_ext4 = "oe_mkext234fs ext4 -T default ${EXTRA_IMAGECMD}"
 
 MIN_BTRFS_SIZE ?= "16384"
 IMAGE_CMD_btrfs () {
--
Quoted 6 lines

2.25.1

--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com