diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c index 40b798a43fa62e0237b3e70162efcaefc76a0f61..eb49fce04c5a290e839575945da722bc97d2f670 100644 --- a/fs/ext4/ext4_common.c +++ b/fs/ext4/ext4_common.c @@ -2229,6 +2229,16 @@ int ext4fs_mount(unsigned part_length) if (__le16_to_cpu(data->sblock.magic) != EXT2_MAGIC) goto fail; + /* + * The 64bit feature was enabled when metadata_csum was enabled + * and we do not support metadata_csum (and cannot reliably find + * files when it is set. Refuse to mount. + */ + if (data->sblock.feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) { + printf("Unsupported feature found (64bit, possibly metadata_csum), not mounting\n"); + goto fail; + } + if (__le32_to_cpu(data->sblock.revision_level == 0)) fs->inodesz = 128; else diff --git a/include/ext4fs.h b/include/ext4fs.h index cc765ae468afdc40359a5df2c6ecca08e3d944e8..13d2c5603bddc0c2bb7dc30aea41240e14e5fccd 100644 --- a/include/ext4fs.h +++ b/include/ext4fs.h @@ -32,6 +32,7 @@ #define EXT4_EXT_MAGIC 0xf30a #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010 #define EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040 +#define EXT4_FEATURE_INCOMPAT_64BIT 0x0080 #define EXT4_INDIRECT_BLOCKS 12 #define EXT4_BG_INODE_UNINIT 0x0001