RFC: Pass TRIM through GELI

Fabian Keil freebsd-listen at fabiankeil.de
Mon Mar 16 14:22:00 UTC 2015


"Matthew D. Fuller" <fullermd at over-yonder.net> wrote:

> On Mon, Mar 16, 2015 at 11:00:31AM +0100 I heard the voice of
> Pawel Jakub Dawidek, and lo! it spake thus:
> >
> > Still would be good to know the root cause of what you are seeing.
> 
> I've about used up my investigation time for right now, but what I've
> found is that onetime providers wind up with no md_magic and no (0)
> md_version, so eli_metadata_decode() EINVAL's right up at the top
> before filling anything into the passed md.  As a result, in
> g_eli_ctl_configure(), it gets (keeps) stack garbage in the var.

If g_eli_configure() is changed to not (try to) read and write
metadata for onetime providers it seems to work as expected:
https://www.fabiankeil.de/sourcecode/electrobsd/g_eli_ctl_configure-Do-not-try-to-read-or-write-meta-from-onetime-providers.diff

A nicer looking solution would be moving all the metadata fiddling
below a if (sc->sc_flags & G_ELI_FLAG_ONETIME) block at the end of
the function where md.md_flags could inherit the flags from
sc->sc_flags.

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/20150316/2d093435/attachment.sig>


More information about the freebsd-geom mailing list