https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206059
Bug ID: 206059 Summary: [ext2fs][patch] EXT4: cannot mount filesystems < 512 MiB in size: "ext2fs: no space for extra inode timestamps" Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: New Keywords: patch Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: damjan....@gmail.com CC: freebsd...@freebsd.org Created attachment 165293 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=165293&action=edit Allow inode size < sizeof(struct ext2fs_dinode) when EXT2F_ROCOMPAT_EXTRA_ISIZE is set When making the EXT4 filesystem, mkfs.ext4 uses different inode sizes depending on the filesystem file. For a large filesystem, "dumpe2fs" returns these relevant fields: Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Inode size: 256 Required extra isize: 28 Desired extra isize: 28 For a small filesystem, "dumpe2fs" returns this instead, and "Required extra isize" and "Desired extra isize" are missing: Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize Inode size: 128 Bisection searching with different filesystem sizes ("dd if=/dev/zero of=/tmp/filesystem bs=1M count=..." + "mkfs.ext4 /tmp/filesystem" + "dumpe2fs -h /tmp/filesystem") shows inode size 256 is used for filesystems >= 512 MiB, and smaller filesystems use inode size 128. Attemping to mount the small filesystems fails with this error (and unless you've patched ext2fs with the patch from bug 206056, also panics the kernel!!): ext2fs: no space for extra inode timestamps That message comes from compute_sb_data() in ext2_vfsops.c, which does /* Check for extra isize in big inodes. */ if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_EXTRA_ISIZE) && EXT2_INODE_SIZE(fs) < sizeof(struct ext2fs_dinode)) { printf("ext2fs: no space for extra inode timestamps\n"); return (EINVAL); } which must be wrong, because even small filesystems have the extra_isize feature set, yet the inode size is 128 which is smaller than sizeof(struct ext2fs_dinode). Since EXT2F_ROCOMPAT_EXTRA_ISIZE isn't used anywhere else in the ext2fs module, I've made a patch that deletes that entire section, and it gets the small filesystems to mount and work. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ freebsd-bugs@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"