From f16544bbc7fb6d5a76e87d9f51ebc95ac3efac10 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 12 Oct 2016 23:25:21 -0400 Subject: [PATCH] add patch do-not-advertise-encryption-support-when-disabled --- do-not-advertise-encryption-support-when-disabled | 47 +++++++++++++++++++++++ series | 1 + timestamps | 7 ++-- 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 do-not-advertise-encryption-support-when-disabled diff --git a/do-not-advertise-encryption-support-when-disabled b/do-not-advertise-encryption-support-when-disabled new file mode 100644 index 00000000..88ea738d --- /dev/null +++ b/do-not-advertise-encryption-support-when-disabled @@ -0,0 +1,47 @@ +ext4: do not advertise encryption support when disabled + +From: Eric Biggers + +The sysfs file /sys/fs/ext4/features/encryption was present on kernels +compiled with CONFIG_EXT4_FS_ENCRYPTION=n. This was misleading because +such kernels do not actually support ext4 encryption. Therefore, only +provide this file on kernels compiled with CONFIG_EXT4_FS_ENCRYPTION=y. + +Note: since the ext4 feature files are all hardcoded to have a contents +of "supported", it really is the presence or absence of the file that is +significant, not the contents (and this change reflects that). + +Signed-off-by: Eric Biggers +Signed-off-by: Theodore Ts'o +Cc: stable@vger.kernel.org +--- + fs/ext4/sysfs.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c +index 73bcfd4..42145be 100644 +--- a/fs/ext4/sysfs.c ++++ b/fs/ext4/sysfs.c +@@ -223,14 +223,18 @@ static struct attribute *ext4_attrs[] = { + EXT4_ATTR_FEATURE(lazy_itable_init); + EXT4_ATTR_FEATURE(batched_discard); + EXT4_ATTR_FEATURE(meta_bg_resize); ++#ifdef CONFIG_EXT4_FS_ENCRYPTION + EXT4_ATTR_FEATURE(encryption); ++#endif + EXT4_ATTR_FEATURE(metadata_csum_seed); + + static struct attribute *ext4_feat_attrs[] = { + ATTR_LIST(lazy_itable_init), + ATTR_LIST(batched_discard), + ATTR_LIST(meta_bg_resize), ++#ifdef CONFIG_EXT4_FS_ENCRYPTION + ATTR_LIST(encryption), ++#endif + ATTR_LIST(metadata_csum_seed), + NULL, + }; +-- +2.8.0.rc3.226.g39d4020 + + diff --git a/series b/series index 964e51c7..f1775de1 100644 --- a/series +++ b/series @@ -2,6 +2,7 @@ update-logging-style-using-PR_CONT fix-incorrect-unlock-on-j_list_lock +do-not-advertise-encryption-support-when-disabled #################################################### # unstable patches diff --git a/timestamps b/timestamps index 7cf722a7..60cd894a 100755 --- a/timestamps +++ b/timestamps @@ -42,6 +42,7 @@ touch -d @1474558786 save-patch touch -d @1475216156 stable-boundary touch -d @1476328373 update-logging-style-using-PR_CONT touch -d @1476328758 fix-incorrect-unlock-on-j_list_lock -touch -d @1476328798 series -touch -d @1476328805 status -touch -d @1476328883 timestamps +touch -d @1476329091 do-not-advertise-encryption-support-when-disabled +touch -d @1476329106 series +touch -d @1476329110 status +touch -d @1476329112 timestamps -- 2.11.4.GIT