summaryrefslogtreecommitdiff
path: root/drivers/md/dm-crypt.c
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2011-09-25 22:26:21 (GMT)
committerAlasdair G Kergon <agk@redhat.com>2011-09-25 22:26:21 (GMT)
commit983c7db347db8ce2d8453fd1d89b7a4bb6920d56 (patch)
treef4302d7eb306b82db4227ba5defe6d178949831b /drivers/md/dm-crypt.c
parent8232480944d173378082ebb2cac8a3207c08cf31 (diff)
downloadlinux-983c7db347db8ce2d8453fd1d89b7a4bb6920d56.tar.xz
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 'drivers/md/dm-crypt.c')
-rw-r--r--drivers/md/dm-crypt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 49da55c..8c2a000 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1698,6 +1698,8 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
}
ti->num_flush_requests = 1;
+ ti->discard_zeroes_data_unsupported = 1;
+
return 0;
bad: