RFC: Pass TRIM through GELI

Matthew D. Fuller fullermd at over-yonder.net
Mon Mar 16 10:13:25 UTC 2015


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.

So actually, it DOESN'T work without nop, things just happen to align
so that stack garbage has a 0 for version (which is valid version)
rather than 2-billion-something (which isn't).


Now, regular providers get init'd in userland, so it's hard to
compare.  However, my current thinking is that onetime does much of
what 'geli attach' does, but not all of what 'geli init' does; it
doesn't ever write out the metadata to the provider since it doesn't
need to persist.  But when configure wants to load the metadata, it
takes it from the provider, and so *boom*.


-- 
Matthew Fuller     (MF4839)   |  fullermd at over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.


More information about the freebsd-geom mailing list