diff options
author | Milan Broz <mbroz@redhat.com> | 2011-09-25 18:26:21 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2011-09-25 18:26:21 -0400 |
commit | 983c7db347db8ce2d8453fd1d89b7a4bb6920d56 (patch) | |
tree | f4302d7eb306b82db4227ba5defe6d178949831b /include/linux | |
parent | 8232480944d173378082ebb2cac8a3207c08cf31 (diff) |
dm crypt: always disable discard_zeroes_data
If optional discard support in dm-crypt is enabled, discards requests
bypass the crypt queue and blocks of the underlying device are discarded.
For the read path, discarded blocks are handled the same as normal
ciphertext blocks, thus decrypted.
So if the underlying device announces discarded regions return zeroes,
dm-crypt must disable this flag because after decryption there is just
random noise instead of zeroes.
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/device-mapper.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 3fa1f3d90ce0..99e3e50b5c57 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -197,6 +197,11 @@ struct dm_target { | |||
197 | * whether or not its underlying devices have support. | 197 | * whether or not its underlying devices have support. |
198 | */ | 198 | */ |
199 | unsigned discards_supported:1; | 199 | unsigned discards_supported:1; |
200 | |||
201 | /* | ||
202 | * Set if this target does not return zeroes on discarded blocks. | ||
203 | */ | ||
204 | unsigned discard_zeroes_data_unsupported:1; | ||
200 | }; | 205 | }; |
201 | 206 | ||
202 | /* Each target can link one of these into the table */ | 207 | /* Each target can link one of these into the table */ |