diff options
author | Eric Biggers <ebiggers@google.com> | 2019-07-22 12:26:24 -0400 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2019-08-12 22:33:51 -0400 |
commit | 22cfe4b48ccb5a3dbb92d6dcb88f396e0f400f74 (patch) | |
tree | a542a34c4ff891e8b361b18c55602304e6487371 /fs/ext4/super.c | |
parent | c93d8f88580921c84d2213161ef3c22560511b84 (diff) |
ext4: add fs-verity read support
Make ext4_mpage_readpages() verify data as it is read from fs-verity
files, using the helper functions from fs/verity/.
To support both encryption and verity simultaneously, this required
refactoring the decryption workflow into a generic "post-read
processing" workflow which can do decryption, verification, or both.
The case where the ext4 block size is not equal to the PAGE_SIZE is not
supported yet, since in that case ext4_mpage_readpages() sometimes falls
back to block_read_full_page(), which does not support fs-verity yet.
Co-developed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 05a9874687c3..23e7acd43e4e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -6104,6 +6104,10 @@ static int __init ext4_init_fs(void) | |||
6104 | 6104 | ||
6105 | err = ext4_init_pending(); | 6105 | err = ext4_init_pending(); |
6106 | if (err) | 6106 | if (err) |
6107 | goto out7; | ||
6108 | |||
6109 | err = ext4_init_post_read_processing(); | ||
6110 | if (err) | ||
6107 | goto out6; | 6111 | goto out6; |
6108 | 6112 | ||
6109 | err = ext4_init_pageio(); | 6113 | err = ext4_init_pageio(); |
@@ -6144,8 +6148,10 @@ out3: | |||
6144 | out4: | 6148 | out4: |
6145 | ext4_exit_pageio(); | 6149 | ext4_exit_pageio(); |
6146 | out5: | 6150 | out5: |
6147 | ext4_exit_pending(); | 6151 | ext4_exit_post_read_processing(); |
6148 | out6: | 6152 | out6: |
6153 | ext4_exit_pending(); | ||
6154 | out7: | ||
6149 | ext4_exit_es(); | 6155 | ext4_exit_es(); |
6150 | 6156 | ||
6151 | return err; | 6157 | return err; |
@@ -6162,6 +6168,7 @@ static void __exit ext4_exit_fs(void) | |||
6162 | ext4_exit_sysfs(); | 6168 | ext4_exit_sysfs(); |
6163 | ext4_exit_system_zone(); | 6169 | ext4_exit_system_zone(); |
6164 | ext4_exit_pageio(); | 6170 | ext4_exit_pageio(); |
6171 | ext4_exit_post_read_processing(); | ||
6165 | ext4_exit_es(); | 6172 | ext4_exit_es(); |
6166 | ext4_exit_pending(); | 6173 | ext4_exit_pending(); |
6167 | } | 6174 | } |