summaryrefslogtreecommitdiffstats
path: root/sys/fs/ext2fs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2014-02-27 16:05:52 +0000
committerpfg <pfg@FreeBSD.org>2014-02-27 16:05:52 +0000
commitea1005cca47f4d3aace134a0acd6809943e46acc (patch)
tree0a4b5a959d0771ff38c90db4930e37e30fb6dada /sys/fs/ext2fs
parentf03d4b82a2f465969dd07b26053fa0f66f344afa (diff)
downloadFreeBSD-src-ea1005cca47f4d3aace134a0acd6809943e46acc.zip
FreeBSD-src-ea1005cca47f4d3aace134a0acd6809943e46acc.tar.gz
MFC r262346:
ext2fs: fully enable ext4 read-only support. The ext4 developers tend to tag Ext4-specific flags as "incompatible" even when such features are not relevant for read-only support. This is a consequence of the process though which this filesystem is implemented without design and the fact that some new features are not extensible to ext2/3. Organize the features according to what we support and sort them so that we can now read-only mount filesystems with some features that may be found in newly formatted ext4 fs. Submitted by: Zheng Liu
Diffstat (limited to 'sys/fs/ext2fs')
-rw-r--r--sys/fs/ext2fs/ext2_vfsops.c3
-rw-r--r--sys/fs/ext2fs/ext2fs.h17
2 files changed, 14 insertions, 6 deletions
diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c
index a18d5cc1..77e08ce 100644
--- a/sys/fs/ext2fs/ext2_vfsops.c
+++ b/sys/fs/ext2fs/ext2_vfsops.c
@@ -290,7 +290,8 @@ ext2_check_sb_compat(struct ext2fs *es, struct cdev *dev, int ronly)
return (1);
}
if (es->e2fs_rev > E2FS_REV0) {
- if (es->e2fs_features_incompat & ~EXT2F_INCOMPAT_SUPP) {
+ if (es->e2fs_features_incompat & ~(EXT2F_INCOMPAT_SUPP |
+ EXT4F_RO_INCOMPAT_SUPP)) {
printf(
"WARNING: mount of %s denied due to unsupported optional features\n",
devtoname(dev));
diff --git a/sys/fs/ext2fs/ext2fs.h b/sys/fs/ext2fs/ext2fs.h
index b562287..fcb2cde 100644
--- a/sys/fs/ext2fs/ext2fs.h
+++ b/sys/fs/ext2fs/ext2fs.h
@@ -200,19 +200,26 @@ struct csum {
* We support the following REV1 features:
* - EXT2F_ROCOMPAT_SPARSESUPER
* - EXT2F_ROCOMPAT_LARGEFILE
+ * - EXT2F_ROCOMPAT_EXTRA_ISIZE
* - EXT2F_INCOMPAT_FTYPE
*
- * We partially (read-only) support the following EXT4 features:
+ * We partially support (read-only) the following EXT4 features:
* - EXT2F_ROCOMPAT_HUGE_FILE
- * - EXT2F_ROCOMPAT_EXTRA_ISIZE
* - EXT2F_INCOMPAT_EXTENTS
+ *
+ * We do not support these EXT4 features but they are irrelevant
+ * for read-only support:
+ * - EXT2F_INCOMPAT_FLEX_BG
+ * - EXT2F_INCOMPAT_META_BG
*/
-#define EXT2F_COMPAT_SUPP 0x0000
+#define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX
#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \
EXT2F_ROCOMPAT_LARGEFILE | \
EXT2F_ROCOMPAT_EXTRA_ISIZE)
-#define EXT2F_INCOMPAT_SUPP (EXT2F_INCOMPAT_FTYPE | \
- EXT2F_INCOMPAT_EXTENTS)
+#define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE
+#define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \
+ EXT2F_INCOMPAT_FLEX_BG | \
+ EXT2F_INCOMPAT_META_BG )
/* Assume that user mode programs are passing in an ext2fs superblock, not
* a kernel struct super_block. This will allow us to call the feature-test
OpenPOWER on IntegriCloud