]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Reserve superblock fields s_lpf_ino and s_encryption_level
authorTheodore Ts'o <tytso@mit.edu>
Sun, 12 Apr 2015 12:51:53 +0000 (08:51 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 12 Apr 2015 12:51:53 +0000 (08:51 -0400)
The s_lpf_ino field is intended to store the location of the lost and
found directory if the root directory becomes encrypted (which is not
yet supported).  The s_encryption_level field is designed to allow
support for future changes in the on-disk ext4 encryption format while
this feature under development, without having to burn a large number
of bits in the incompat feature flag.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/set_fields.c
lib/ext2fs/ext2_fs.h
lib/ext2fs/tst_super_size.c

index 902b0a6b69401773cbd97349fbd4f050b492f956..7d1a3556ac8aa5a5cf4d29be51fadbae0919cf22 100644 (file)
@@ -154,6 +154,7 @@ static struct field_set_info super_fields[] = {
          FLAG_ARRAY, 2 },
        { "checksum", &set_sb.s_checksum, NULL, 4, parse_uint },
        { "checksum_type", &set_sb.s_checksum_type, NULL, 1, parse_uint },
+       { "encryption_level", &set_sb.s_encryption_level, NULL, 1, parse_uint },
        { "error_count", &set_sb.s_error_count, NULL, 4, parse_uint },
        { "first_error_time", &set_sb.s_first_error_time, NULL, 4, parse_time },
        { "first_error_ino", &set_sb.s_first_error_ino, NULL, 4, parse_uint },
@@ -168,6 +169,7 @@ static struct field_set_info super_fields[] = {
        { "encrypt_algos", &set_sb.s_encrypt_algos, NULL, 1, parse_uint,
          FLAG_ARRAY, 4 },
        { "encrypt_pw_salt", &set_sb.s_encrypt_pw_salt, NULL, 16, parse_uuid },
+       { "lpf_ino", &set_sb.s_lpf_ino, NULL, 4, parse_uint },
        { 0, 0, 0, 0 }
 };
 
index 586b5b4c4cbf3e04b3db2284b702cb2c68f37fc4..a755cfac8eae3e7328e5ed6811d18b0614e75fbd 100644 (file)
@@ -688,7 +688,8 @@ struct ext2_super_block {
        __u32   s_raid_stripe_width;    /* blocks on all data disks (N*stride)*/
        __u8    s_log_groups_per_flex;  /* FLEX_BG group size */
        __u8    s_checksum_type;        /* metadata checksum algorithm */
-       __u16   s_reserved_pad;         /* Padding to next 32bits */
+       __u8    s_encryption_level;     /* versioning level for encryption */
+       __u8    s_reserved_pad;         /* Padding to next 32bits */
        __u64   s_kbytes_written;       /* nr of lifetime kilobytes written */
        __u32   s_snapshot_inum;        /* Inode number of active snapshot */
        __u32   s_snapshot_id;          /* sequential ID of active snapshot */
@@ -715,7 +716,8 @@ struct ext2_super_block {
        __u32   s_backup_bgs[2];        /* If sparse_super2 enabled */
        __u8    s_encrypt_algos[4];     /* Encryption algorithms in use  */
        __u8    s_encrypt_pw_salt[16];  /* Salt used for string2key algorithm */
-       __u32   s_reserved[101];        /* Padding to the end of the block */
+       __le32  s_lpf_ino;              /* Location of the lost+found inode */
+       __le32  s_reserved[100];        /* Padding to the end of the block */
        __u32   s_checksum;             /* crc32c(superblock) */
 };
 
index c536abd794f203a9ade611da4bed6646b886ce3e..8e3c21fbde49d815b4acc87a57dc7122bad4f9ca 100644 (file)
@@ -114,7 +114,8 @@ int main(int argc, char **argv)
        check_field(s_raid_stripe_width, 4);
        check_field(s_log_groups_per_flex, 1);
        check_field(s_checksum_type, 1);
-       check_field(s_reserved_pad, 2);
+       check_field(s_encryption_level, 1);
+       check_field(s_reserved_pad, 1);
        check_field(s_kbytes_written, 8);
        check_field(s_snapshot_inum, 4);
        check_field(s_snapshot_id, 4);
@@ -138,7 +139,8 @@ int main(int argc, char **argv)
        check_field(s_backup_bgs, 8);
        check_field(s_encrypt_algos, 4);
        check_field(s_encrypt_pw_salt, 16);
-       check_field(s_reserved, 101 * 4);
+       check_field(s_lpf_ino, 4);
+       check_field(s_reserved, 100 * 4);
        check_field(s_checksum, 4);
        do_field("Superblock end", 0, 0, cur_offset, 1024);
 #endif