diff options
author | Theodore Ts'o <tytso@mit.edu> | 2011-04-18 17:29:14 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-04-18 17:29:14 -0400 |
commit | 2035e776050aea57fb5255557216473e82793f2c (patch) | |
tree | 6a97e536fd5fbdc29e4b471195a5dd5a0df35fc6 /fs/ext4/ext4.h | |
parent | 26626f1172fb4f3f323239a6a5cf4e082643fa46 (diff) |
ext4: check for ext[23] file system features when mounting as ext[23]
Provide better emulation for ext[23] mode by enforcing that the file
system does not have any unsupported file system features as defined
by ext[23] when emulating the ext[23] file system driver when
CONFIG_EXT4_USE_FOR_EXT23 is defined.
This causes the file system type information in /proc/mounts to be
correct for the automatically mounted root file system. This also
means that "mount -t ext2 /dev/sda /mnt" will fail if /dev/sda
contains an ext3 or ext4 file system, just as one would expect if the
original ext2 file system driver were in use.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 4daaf2b753f4..076c5d212a3c 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -1351,6 +1351,21 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei) | |||
1351 | #define EXT4_FEATURE_INCOMPAT_EA_INODE 0x0400 /* EA in inode */ | 1351 | #define EXT4_FEATURE_INCOMPAT_EA_INODE 0x0400 /* EA in inode */ |
1352 | #define EXT4_FEATURE_INCOMPAT_DIRDATA 0x1000 /* data in dirent */ | 1352 | #define EXT4_FEATURE_INCOMPAT_DIRDATA 0x1000 /* data in dirent */ |
1353 | 1353 | ||
1354 | #define EXT2_FEATURE_COMPAT_SUPP EXT4_FEATURE_COMPAT_EXT_ATTR | ||
1355 | #define EXT2_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \ | ||
1356 | EXT4_FEATURE_INCOMPAT_META_BG) | ||
1357 | #define EXT2_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ | ||
1358 | EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ | ||
1359 | EXT4_FEATURE_RO_COMPAT_BTREE_DIR) | ||
1360 | |||
1361 | #define EXT3_FEATURE_COMPAT_SUPP EXT4_FEATURE_COMPAT_EXT_ATTR | ||
1362 | #define EXT3_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \ | ||
1363 | EXT4_FEATURE_INCOMPAT_RECOVER| \ | ||
1364 | EXT4_FEATURE_INCOMPAT_META_BG) | ||
1365 | #define EXT3_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ | ||
1366 | EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ | ||
1367 | EXT4_FEATURE_RO_COMPAT_BTREE_DIR) | ||
1368 | |||
1354 | #define EXT4_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR | 1369 | #define EXT4_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR |
1355 | #define EXT4_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \ | 1370 | #define EXT4_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \ |
1356 | EXT4_FEATURE_INCOMPAT_RECOVER| \ | 1371 | EXT4_FEATURE_INCOMPAT_RECOVER| \ |