common/populate: fix S_IFDIR.FMT_BLOCK and ATTR.FMT_LOCAL for ext4 encryption
authorTheodore Ts'o <tytso@mit.edu>
Tue, 12 Dec 2017 05:19:37 +0000 (00:19 -0500)
committerEryu Guan <eguan@redhat.com>
Thu, 14 Dec 2017 04:39:57 +0000 (12:39 +0800)
When ext4 encryption is enabled, the directory entries are encrypted
so we need to create fewer directory entries to guarantee that they
will all fit in a single block.

Also, the encryption metadata takes up extended attribute room so we
can only add a single xattr to guarantee that the xattrs will fit in
the inode.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/populate

index b77c508107fefed346b6bb4b010001ffe764e1aa..07ea7e60a4204c2a7e1117785d6149d215705275 100644 (file)
@@ -343,7 +343,7 @@ _scratch_ext4_populate() {
 
        # - BLOCK
        echo "+ block dir"
 
        # - BLOCK
        echo "+ block dir"
-       __populate_create_dir "${SCRATCH_MNT}/S_IFDIR.FMT_BLOCK" "$((dblksz / 24))"
+       __populate_create_dir "${SCRATCH_MNT}/S_IFDIR.FMT_BLOCK" "$((dblksz / 32))"
 
        # - HTREE
        echo "+ htree dir"
 
        # - HTREE
        echo "+ htree dir"
@@ -369,7 +369,7 @@ _scratch_ext4_populate() {
        # Attribute formats
        # LOCAL
        echo "+ local attr"
        # Attribute formats
        # LOCAL
        echo "+ local attr"
-       __populate_create_attr "${SCRATCH_MNT}/ATTR.FMT_LOCAL" 1
+       __populate_create_attr "${SCRATCH_MNT}/ATTR.FMT_LOCAL" 0
 
        # BLOCK
        echo "+ block attr"
 
        # BLOCK
        echo "+ block attr"