add patch fix-ocfs2-corrupt-when-updating-journal-superblock-fails
[ext4-patch-queue.git] / setup_encryption_info_after_inheritance
blob44bc41bd0803b970498fa0edf5f45d20400fb9b3
1 ext4 crypto: set up encryption info for new inodes in ext4_inherit_context()
3 Set up the encryption information for newly created inodes immediately
4 after they inherit their encryption context from their parent
5 directories.
7 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 ---
9  fs/ext4/crypto_policy.c | 1 +
10  1 file changed, 1 insertion(+)
12 diff --git a/fs/ext4/crypto_policy.c b/fs/ext4/crypto_policy.c
13 index 683391f..81980a15 100644
14 --- a/fs/ext4/crypto_policy.c
15 +++ b/fs/ext4/crypto_policy.c
16 @@ -206,6 +206,7 @@ int ext4_inherit_context(struct inode *parent, struct inode *child)
17         if (!res) {
18                 ext4_set_inode_flag(child, EXT4_INODE_ENCRYPT);
19                 ext4_clear_inode_state(child, EXT4_STATE_MAY_INLINE_DATA);
20 +               res = ext4_get_encryption_info(child);
21         }
22         return res;
23  }