commit 983c7db347db8ce2d8453fd1d89b7a4bb6920d56 Author: Milan Broz Date: Sun Sep 25 23:26:21 2011 +0100 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 Signed-off-by: Alasdair G Kergon --- drivers/md/dm-crypt.c | 2 ++ 1 file changed, 2 insertions(+) Index: rhel6-compile/drivers/md/dm-crypt.c =================================================================== --- rhel6-compile.orig/drivers/md/dm-crypt.c 2014-05-10 16:55:03.000000000 +0200 +++ rhel6-compile/drivers/md/dm-crypt.c 2014-05-10 16:55:05.000000000 +0200 @@ -1505,6 +1505,8 @@ static int crypt_ctr(struct dm_target *t } ti->num_flush_requests = 1; + ti->discard_zeroes_data_unsupported = 1; + return 0; bad: