]> git.baikalelectronics.ru Git - kernel.git/commit
dm crypt: always disable discard_zeroes_data
authorMilan Broz <mbroz@redhat.com>
Sun, 25 Sep 2011 22:26:21 +0000 (23:26 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Sun, 25 Sep 2011 22:26:21 +0000 (23:26 +0100)
commit7adeb63acd8aaf7931316c70c5c07f15461babf3
treef4302d7eb306b82db4227ba5defe6d178949831b
parent5aa0aaa7f54432055307f3120d1ae040d8e106ff
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>
drivers/md/dm-crypt.c
drivers/md/dm-table.c
include/linux/device-mapper.h