FS#26610 - [cryptsetup] add descard support to initrd hook

Attached to Project: Arch Linux
Opened by Christian Hesse (eworm) - Tuesday, 25 October 2011, 10:25 GMT
Last edited by Thomas Bächler (brain0) - Tuesday, 08 November 2011, 19:23 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

From the cryptsetup 1.4.0-rc1 announcement (Milan Broz to the dm-crypt ml):
> * Support --enable-discards option to allow discards/TRIM requests.
>
> Since kernel 3.1, dm-crypt devices optionally (not by default) support
> block discards (TRIM) comands.
> If you want to enable this operation, you have to enable it manually
> on every activation using --enable-discards
>
> cryptsetup luksOpen --enable-discards /dev/sdb test_disk
>
> WARNING: There are several security consequences, please read at least
> http://asalor.blogspot.com/2011/08/trim-dm-crypt-problems.html
> before you enable it.

Im running cryptsetup svn (https://aur.archlinux.org/packages.php?ID=51344) with a modified initrd hook and patched device mapper modules for kernel 3.0. Works great so far.

I would like to have this in official cryptsetup package when cryptsetup 1.4.0 is released, if possible disabled by default and enabled by a boot option.
What would be the preferred syntax? Something like "cryptdevice=/dev/sda2:cvg:discard" or a single option "discard" or "allow_discard"?
This task depends upon

Closed by  Thomas Bächler (brain0)
Tuesday, 08 November 2011, 19:23 GMT
Reason for closing:  Implemented
Comment by Christian Hesse (eworm) - Tuesday, 25 October 2011, 11:01 GMT
Ok, here is an updated initrd hook. It accepts additional options for cryptdevice:

cryptdevice=/dev/sda2:cvg:option1,option2,...

The only valid option atm is "allow-discards" as known to cryptsetup.

Loading...