diff options
author | Eric Biggers <ebiggers@google.com> | 2016-10-12 23:24:51 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-10-12 23:24:51 -0400 |
commit | c4704a4fbe834eee4109ca064131d440941f6235 (patch) | |
tree | a5f4bccc9c151ba68bca4a090704451fb6b95d98 | |
parent | 559cce698eaf4ccecb2213b2519ea3a0413e5155 (diff) |
ext4: do not advertise encryption support when disabled
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 <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
-rw-r--r-- | fs/ext4/sysfs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c index 73bcfd41f5f2..42145be5c6b4 100644 --- a/fs/ext4/sysfs.c +++ b/fs/ext4/sysfs.c | |||
@@ -223,14 +223,18 @@ static struct attribute *ext4_attrs[] = { | |||
223 | EXT4_ATTR_FEATURE(lazy_itable_init); | 223 | EXT4_ATTR_FEATURE(lazy_itable_init); |
224 | EXT4_ATTR_FEATURE(batched_discard); | 224 | EXT4_ATTR_FEATURE(batched_discard); |
225 | EXT4_ATTR_FEATURE(meta_bg_resize); | 225 | EXT4_ATTR_FEATURE(meta_bg_resize); |
226 | #ifdef CONFIG_EXT4_FS_ENCRYPTION | ||
226 | EXT4_ATTR_FEATURE(encryption); | 227 | EXT4_ATTR_FEATURE(encryption); |
228 | #endif | ||
227 | EXT4_ATTR_FEATURE(metadata_csum_seed); | 229 | EXT4_ATTR_FEATURE(metadata_csum_seed); |
228 | 230 | ||
229 | static struct attribute *ext4_feat_attrs[] = { | 231 | static struct attribute *ext4_feat_attrs[] = { |
230 | ATTR_LIST(lazy_itable_init), | 232 | ATTR_LIST(lazy_itable_init), |
231 | ATTR_LIST(batched_discard), | 233 | ATTR_LIST(batched_discard), |
232 | ATTR_LIST(meta_bg_resize), | 234 | ATTR_LIST(meta_bg_resize), |
235 | #ifdef CONFIG_EXT4_FS_ENCRYPTION | ||
233 | ATTR_LIST(encryption), | 236 | ATTR_LIST(encryption), |
237 | #endif | ||
234 | ATTR_LIST(metadata_csum_seed), | 238 | ATTR_LIST(metadata_csum_seed), |
235 | NULL, | 239 | NULL, |
236 | }; | 240 | }; |