From 991211f676f49c6cf30af368dade2f81287f1fa8 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 17 Feb 2012 13:54:47 -0500 Subject: [PATCH] libext2fs, libe2p: Reserve RO_COMPAT_REPLICA feature The replica is a feature which stores multiple copies of the key metadata blocks so a single block failure in failure-prone media (read: certain types of flash storage) doesn't take out the entire file system. Discussion on the upstream list proved not to be very positive on this feature; the arguments were that it added complexity that wasn't warrented, since common practice in industry is to insist on reliable media, and if media is unreliable, you're kind of toast anyway (unless the file system is being used as the back-end store of a cluster file system where checksuming and data replication is happening above the local disk file system level). So, this feature is being developed out of tree. We reserve the code points so that other people won't accidentally step on them. Since it's not upstream, it's a soft reservation, but it's not like we have any shortage of RO_COMPAT features. We are a bit more tight on reserved inodes, but EXT2_BOOT_LOADER_INO and EXT2_UNDEL_DIR_INO are not currently used anywhere, and EXT2_EXCLUDE_INO is a reservation for another out-of-tree feature. There are no features currently being discussed which require a reserved inode, but if a need were to arise, we can claw back code point reservations that were never used or not in tree, as those will always be considered lower priority than in-tree features. Cc: Aditya Kali Signed-off-by: "Theodore Ts'o" --- lib/e2p/feature.c | 2 ++ lib/ext2fs/ext2_fs.h | 2 ++ lib/ext2fs/ext2fs.h | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/e2p/feature.c b/lib/e2p/feature.c index 63486f37..19e6f0cc 100644 --- a/lib/e2p/feature.c +++ b/lib/e2p/feature.c @@ -64,6 +64,8 @@ static struct feature feature_list[] = { "bigalloc"}, { E2P_FEATURE_RO_INCOMPAT, EXT4_FEATURE_RO_COMPAT_METADATA_CSUM, "metadata_csum"}, + { E2P_FEATURE_RO_INCOMPAT, EXT4_FEATURE_RO_COMPAT_REPLICA, + "replica" }, { E2P_FEATURE_INCOMPAT, EXT2_FEATURE_INCOMPAT_COMPRESSION, "compression" }, diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index 0f8cde8a..3b012856 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -51,6 +51,7 @@ #define EXT2_RESIZE_INO 7 /* Reserved group descriptors inode */ #define EXT2_JOURNAL_INO 8 /* Journal inode */ #define EXT2_EXCLUDE_INO 9 /* The "exclude" inode, for snapshots */ +#define EXT4_REPLICA_INO 10 /* Used by non-upstream feature */ /* First non-reserved inode for old ext2 filesystems */ #define EXT2_GOOD_OLD_FIRST_INO 11 @@ -707,6 +708,7 @@ struct ext2_super_block { #define EXT4_FEATURE_RO_COMPAT_QUOTA 0x0100 #define EXT4_FEATURE_RO_COMPAT_BIGALLOC 0x0200 #define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM 0x0400 +#define EXT4_FEATURE_RO_COMPAT_REPLICA 0x0800 #define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 #define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h index 68afdff2..682f0cd0 100644 --- a/lib/ext2fs/ext2fs.h +++ b/lib/ext2fs/ext2fs.h @@ -610,7 +610,7 @@ typedef struct ext2_icount *ext2_icount_t; * to ext2fs_openfs() */ #define EXT2_LIB_SOFTSUPP_INCOMPAT (0) -#define EXT2_LIB_SOFTSUPP_RO_COMPAT (EXT4_FEATURE_RO_COMPAT_BIGALLOC) +#define EXT2_LIB_SOFTSUPP_RO_COMPAT (EXT4_FEATURE_RO_COMPAT_REPLICA) /* Translate a block number to a cluster number */