]> git.karo-electronics.de Git - karo-tx-linux.git/commit
If optional discard support in dm-crypt is enabled, discards requests
authorMilan Broz <mbroz@redhat.com>
Tue, 9 Aug 2011 23:13:33 +0000 (09:13 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 9 Aug 2011 23:17:56 +0000 (09:17 +1000)
commitbd04e1aef495761f5bc543f6fbc4857830566d0b
tree1f57f836e21e2a495646cd936715b2090294c938
parenta16a20ae2e99e4e2f53e8f3383b4626ac3a2db8d
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