--allow-discards ignored for TrueCrypt volumes
Issue 197 by rkj... on 2014-01-10 21:33:28:
<b>What steps will reproduce the problem?</b>
- Create an encrypted volume using TrueCrypt
- Open the volume using cryptsetup, specifying --type=tcrypt and --allow-discards.
- run 'dmsetup table' to check the created mapping
The expected output would include '1 allow_discards' at the end of the table entry. Instead, the option is not included in the table, and thus discard cannot be used.
I am using cryptsetup 1.6.2
It looks like this should be a pretty simple fix. I added
if \(opt\_allow\_discards\)
flags |= CRYPT\_ACTIVATE\_ALLOW\_DISCARDS;
below
if \(opt\_readonly\)
flags |= CRYPT\_ACTIVATE\_READONLY;
in action_open_tcrypt() and everything appears to work properly.