Currently ext2fs driver has ability to access a ext4 file system in read-only mode under some specific features. But it couldn't mount a ext4 file system that is created from scratch because uninit_bg and flex_bg features will be enabled by default. Hence the user would be trouble with this if he/she wants to access a ext4 file system with default features in read-only mode. This patch tries to fix this issue. In the patch, all we need to do is to define a new flag set called 'EXT4F_RO_INCOMPAT_SUPP' in order to prevent the user from trying to mount a ext4 file system in read- write mode and do some sanity check. uninit_bg is a read-only compatible feature in ext4. It is used to mark which block group is uninitialised. This feature can save the time when a user creates a ext4 file system because 'mkfs' doesn't try to zero out inode/block bitmap and inode table. Meanwhile 'fsck' will skip uninitialised block group for the same purpose. flex_bg is an incompatible feature in ext4. It tries to put multiple block groups tie together as one logical block group [1]. After enabling this feature we will get more continuous disk space. 1. https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Flexible_Block_Groups Fix: The attached patch tries to fix this problem. Patch attached with submission follows: How-To-Repeat: mkfs.ext4 ${DEV} mount -t ext2fs -ro ${DEV} ${MNT} The user will get an error message when he/she tries to mount a ext4 file system due to some unsupported features.
Responsible Changed From-To: freebsd-bugs->freebsd-fs Over to maintainer(s).
State Changed From-To: open->closed Variant committed as r262346 and MFC'd, Thank you for your contribution!
Responsible Changed From-To: freebsd-fs->pfg Grab it as I committed a variant already.