1 ext4 crypto: Return error code on key retrieval failure and retry crypto after interrupted
3 From: Michael Halcrow <mhalcrow@google.com>
5 Signed-of-by: Michael Halcrow <mhalcrow@google.com>
6 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 fs/ext4/crypto.c | 5 ++++-
9 1 file changed, 4 insertions(+), 1 deletion(-)
11 diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c
12 index f81b804..ead3111 100644
13 --- a/fs/ext4/crypto.c
14 +++ b/fs/ext4/crypto.c
15 @@ -629,7 +629,7 @@ static int ext4_get_wrapping_key(
17 BUG_ON(sig[EXT4_WRAPPING_KEY_SIG_NULL_TERMINATED_SIZE - 1] != '\0');
18 res = ext4_get_wrapping_key_from_keyring(wrapping_key, sig);
24 @@ -1048,6 +1048,7 @@ int ext4_set_crypto_key(struct dentry *dentry)
25 struct ext4_inode_info *ei = EXT4_I(inode);
29 ext4_generate_encryption_key(dentry);
30 res = ext4_wrap_key(wrapped_key_packet, &wrapped_key_packet_size,
31 &ei->i_encryption_key, inode);
32 @@ -1062,6 +1063,8 @@ int ext4_set_crypto_key(struct dentry *dentry)
33 root_packet, root_packet_size, 0);
38 ei->i_encryption_key.mode = EXT4_ENCRYPTION_MODE_INVALID;
39 printk_ratelimited(KERN_ERR "%s: res = [%d]\n", __func__, res);
42 2.1.0.rc2.206.gedb03e5