diff --git a/fs/ext4/super.c b/fs/ext4/super.c index cf2f612..a8c599a 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1991,6 +1991,17 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) printk(KERN_WARNING "EXT4-fs warning: feature flags set on rev 0 fs, " "running e2fsck is recommended\n"); + + /* + * Since ext4 is still considered development code, we require + * that the TEST_FILESYS flag in s->flags be set. + */ + if (!(le32_to_cpu(es->s_flags) & EXT2_FLAGS_TEST_FILESYS)) { + printk(KERN_WARNING, "EXT4-fs: %s: test filesystem flag " + "not set.\n"); + goto failed_mount; + } + /* * Check feature flags regardless of the revision level, since we * previously didn't change the revision level when setting the flags, diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h index 98d1c3c..d203543 100644 --- a/include/linux/ext4_fs.h +++ b/include/linux/ext4_fs.h @@ -547,6 +547,13 @@ do { \ #define EXT4_ORPHAN_FS 0x0004 /* Orphans being recovered */ /* + * Misc. filesystem flags + */ +#define EXT2_FLAGS_SIGNED_HASH 0x0001 /* Signed dirhash in use */ +#define EXT2_FLAGS_UNSIGNED_HASH 0x0002 /* Unsigned dirhash in use */ +#define EXT2_FLAGS_TEST_FILESYS 0x0004 /* OK for use on development code */ + +/* * Mount flags */ #define EXT4_MOUNT_CHECK 0x00001 /* Do mount-time checks */