RFC: Pass TRIM through GELI
Fabian Keil
freebsd-listen at fabiankeil.de
Sun May 3 13:26:06 UTC 2015
"Matthew D. Fuller" <fullermd at over-yonder.net> wrote:
> > > But that lack of checking is a Real Bug by itself anyway, so merits
> > > a fix.
> > Stuffed into bugzilla as
> > <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198860>
>
> [...]
>
> > After last round, everybody seems happy enough with this, so I've
> > filed it as
> > <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198863>.
>
> Does anybody have outstanding concerns on these? Or, if not, what
> else do we need to move them along? They're working fine for me
> here...
One minor issue I ran into is that a patched kernel will
reject onetime requests from an unpatched userland:
$ geli version
kernel: 7
userland: 7
$ geli onetime -s 4096 /dev/gpt/swap-ada0
geli: Missing trim argument
If the update steps are:
1) Update kernel
2) Reboot
3) Update userland
the system will not be able to attach an encrypted swap partition
at step 2.
The culprit is:
@@ -256,12 +256,19 @@ g_eli_ctl_onetime(struct gctl_req *req, struct g_class *mp)
gctl_error(req, "No '%s' argument.", "detach");
return;
}
+ trim = gctl_get_paraml(req, "trim", sizeof(*trim));
+ if (trim == NULL) {
+ gctl_error(req, "No '%s' argument.", "trim");
+ return;
+ }
This patch fixes this:
https://www.fabiankeil.de/sourcecode/electrobsd/geli-Accept-onetime-requests-from-userland-without-Trim-support.diff
BTW, the gctl_error() call is superfluous because it's already
called by gctl_get_paraml() and only the first error is recorded.
Looks like lots of gctl_error() calls in the file could be removed.
Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20150503/65aae6cf/attachment.sig>
More information about the freebsd-geom
mailing list