Created attachment 154746 [details] Patch to geli to enable passthru Add a flag -t to init/onetime to enable TRIM passthru, and -[tT] to configure to adjust it on existing providers. This will cause GELI to transparently pass through BIO_DELETE's to the underlying provider, so space on things like zvol's can be reclaimed, and SSD's can clean up unused sectors. This includes a fix from Fabian Keil <freebsd-listen@fabiankeil.de> for 'configure' on onetime providers which is not strictly related, but is entangled in the same code, so would cause conflicts if separated out. Has been discussed on -geom@ (https://lists.freebsd.org/pipermail/freebsd-geom/2015-March/006070.html) and has general approval there.
Created attachment 154855 [details] Patch to swapon for fstab auto-ELI Here's an additional patch on top that allows setting the 'trim' flag on the mount options in fstab, for swapon's automatic .eli creation.
Created attachment 156615 [details] Patch to geli to enable passthru Update to previous patch with a few adjustments to allow unpatched userland to still onetime/configure with patched kernel.
Created attachment 158599 [details] Patch to geli to enable passthru Updated patch which inverts the sense of the flag from FLAG_DELETE to FLAG_NODELETE, leaving the unflagged (and default) case to enable TRIM.
Created attachment 158601 [details] Patch to swapon for fstab auto-ELI Updated to use 'notrim' flag match new geli patch.
Comment on attachment 154855 [details] Patch to swapon for fstab auto-ELI Superceded
A commit references this bug: Author: pjd Date: Sat Aug 8 09:51:41 UTC 2015 New revision: 286444 URL: https://svnweb.freebsd.org/changeset/base/286444 Log: Enable BIO_DELETE passthru in GELI, so TRIM/UNMAP can work as expected when GELI is used on a SSD or inside virtual machine, so that guest can tell host that it is no longer using some of the storage. Enabling BIO_DELETE passthru comes with a small security consequence - an attacker can tell how much space is being really used on encrypted device and has less data no analyse then. This is why the -T option can be given to the init subcommand to turn off this behaviour and -t/T options for the configure subcommand can be used to adjust this setting later. PR: 198863 Submitted by: Matthew D. Fuller fullermd at over-yonder dot net This commit also includes a fix from Fabian Keil freebsd-listen at fabiankeil.de for 'configure' on onetime providers which is not strictly related, but is entangled in the same code, so would cause conflicts if separated out. Changes: head/sbin/geom/class/eli/geli.8 head/sbin/geom/class/eli/geom_eli.c head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h head/sys/geom/eli/g_eli_ctl.c
A commit references this bug: Author: pjd Date: Sat Aug 8 09:57:40 UTC 2015 New revision: 286445 URL: https://svnweb.freebsd.org/changeset/base/286445 Log: Allow to disable BIO_DELETE passthru in fstab for swap-on-geli devices by passing 'notrim' option. PR: 198863 Submitted by: Matthew D. Fuller fullermd at over-yonder dot net Changes: head/sbin/swapon/swapon.c head/share/man/man5/fstab.5
Are there plans to mfc this to stable10?
Would be nice to have it in 10.3... :)
MARKED AS SPAM
For bugs matching the following conditions: - Status == In Progress - Assignee == "bugs@FreeBSD.org" - Last Modified Year <= 2017 Do - Set Status to "Open"
I think at this point it's safe to say this likely won't be MFC'd to stable/10, which goes EoL in the next few months. It is, however, in 11.1 and 11.2.
*** Bug 182713 has been marked as a duplicate of this bug. ***