1 ext4 crypto: policies may only be set on directories
3 Thanks to Chao Yu <chao2.yu@samsung.com> for pointing out we were
6 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 fs/ext4/crypto_policy.c | 2 ++
9 1 file changed, 2 insertions(+)
11 diff --git a/fs/ext4/crypto_policy.c b/fs/ext4/crypto_policy.c
12 index 81980a15..a1d434d 100644
13 --- a/fs/ext4/crypto_policy.c
14 +++ b/fs/ext4/crypto_policy.c
15 @@ -93,6 +93,8 @@ int ext4_process_policy(const struct ext4_encryption_policy *policy,
18 if (!ext4_inode_has_encryption_context(inode)) {
19 + if (!S_ISDIR(inode->i_mode))
21 if (!ext4_empty_dir(inode))
23 return ext4_create_encryption_context_from_policy(inode,