Skip to contentSkip to conversation

common/populate: fix S_IFDIR.FMT_BLOCK and ATTR.FMT_LOCAL for ext4 encryption

PATCH New Theodore Ts'o 1 participant 1 message Dec 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/populate: fix S_IFDIR.FMT_BLOCK and ATTR.FMT_LOCAL for ext4 encryption

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.

---
 common/populate | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/populate +2 -2
index b77c5081..07ea7e60 100644
@@ -343,7 +343,7 @@ _scratch_ext4_populate() {
 
 	# - 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"
@@ -369,7 +369,7 @@ _scratch_ext4_populate() {
 	# 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"
Signature · 1 line
2.11.0.rc0.7.gbe5a750