aboutsummaryrefslogtreecommitdiff
path: root/lib/ext2fs
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-10-21 16:30:43 -0700
committerEric Biggers <ebiggers@google.com>2019-10-25 14:04:47 -0700
commit9aa30c254dd57df54f00c5d520b7ac867ad7ca68 (patch)
tree59da580e4b5a3a72a6bac6965f75bc43d0005cc1 /lib/ext2fs
parent47cba40d11aa6ae054df057ea84bf3169ad99ab7 (diff)
downloade2fsprogs-9aa30c254dd57df54f00c5d520b7ac867ad7ca68.tar.gz
BACKPORT, FROMLIST: Support the stable_inodes feature
Reserve the codepoint for EXT4_FEATURE_COMPAT_STABLE_INODES, allow it to be set and cleared, and teach resize2fs to forbid shrinking the filesystem if it is set. This feature will allow the use of encryption policies where the inode number is included in the IVs (initialization vectors) for encryption, so data would be corrupted if the inodes were to be renumbered. For more details, see the kernel patchset: https://lkml.kernel.org/linux-fsdevel/20191021230355.23136-1-ebiggers@kernel.org/T/#u (cherry-picked from https://lkml.kernel.org/linux-ext4/20191021233043.36225-1-ebiggers@kernel.org and resolved conflicts with this branch not having the fast_commit feature yet.) Change-Id: Ib100eec48d3fe990ef5df5823b0aaca7b74f039d Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'lib/ext2fs')
-rw-r--r--lib/ext2fs/ext2_fs.h2
-rw-r--r--lib/ext2fs/ext2fs.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h
index cbb44bdb..c303ff44 100644
--- a/lib/ext2fs/ext2_fs.h
+++ b/lib/ext2fs/ext2_fs.h
@@ -810,6 +810,7 @@ struct ext2_super_block {
/* #define EXT2_FEATURE_COMPAT_EXCLUDE_INODE 0x0080 not used, legacy */
#define EXT2_FEATURE_COMPAT_EXCLUDE_BITMAP 0x0100
#define EXT4_FEATURE_COMPAT_SPARSE_SUPER2 0x0200
+#define EXT4_FEATURE_COMPAT_STABLE_INODES 0x0800
#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
@@ -911,6 +912,7 @@ EXT4_FEATURE_COMPAT_FUNCS(dir_index, 2, DIR_INDEX)
EXT4_FEATURE_COMPAT_FUNCS(lazy_bg, 2, LAZY_BG)
EXT4_FEATURE_COMPAT_FUNCS(exclude_bitmap, 2, EXCLUDE_BITMAP)
EXT4_FEATURE_COMPAT_FUNCS(sparse_super2, 4, SPARSE_SUPER2)
+EXT4_FEATURE_COMPAT_FUNCS(stable_inodes, 4, STABLE_INODES)
EXT4_FEATURE_RO_COMPAT_FUNCS(sparse_super, 2, SPARSE_SUPER)
EXT4_FEATURE_RO_COMPAT_FUNCS(large_file, 2, LARGE_FILE)
diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
index 59fd9742..5012b50d 100644
--- a/lib/ext2fs/ext2fs.h
+++ b/lib/ext2fs/ext2fs.h
@@ -611,7 +611,8 @@ typedef struct ext2_icount *ext2_icount_t;
EXT2_FEATURE_COMPAT_RESIZE_INODE|\
EXT2_FEATURE_COMPAT_DIR_INDEX|\
EXT2_FEATURE_COMPAT_EXT_ATTR|\
- EXT4_FEATURE_COMPAT_SPARSE_SUPER2)
+ EXT4_FEATURE_COMPAT_SPARSE_SUPER2|\
+ EXT4_FEATURE_COMPAT_STABLE_INODES)
#ifdef CONFIG_MMP
#define EXT4_LIB_INCOMPAT_MMP EXT4_FEATURE_INCOMPAT_MMP