From owner-freebsd-geom@FreeBSD.ORG Mon Mar 16 14:22:00 2015 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 980E8F5D for ; Mon, 16 Mar 2015 14:22:00 +0000 (UTC) Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.31.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5275F87F for ; Mon, 16 Mar 2015 14:21:59 +0000 (UTC) Received: from [87.79.198.241] (helo=fabiankeil.de) by smtprelay02.ispgateway.de with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1YXVqA-0006xV-HD for freebsd-geom@freebsd.org; Mon, 16 Mar 2015 15:17:58 +0100 Date: Mon, 16 Mar 2015 15:17:58 +0100 From: Fabian Keil To: freebsd-geom@freebsd.org Subject: Re: RFC: Pass TRIM through GELI Message-ID: <3d5629f4.63dcb347@fabiankeil.de> In-Reply-To: <20150316101323.GD52331@over-yonder.net> References: <20150308000131.GP1742@over-yonder.net> <20150314151453.GJ24274@over-yonder.net> <501bca86.508d8e26@fabiankeil.de> <20150315145324.GA52331@over-yonder.net> <20150315182444.GB52331@over-yonder.net> <20150316010845.GA1515@garage.freebsd.pl> <20150316092126.GC52331@over-yonder.net> <20150316100030.GB1515@garage.freebsd.pl> <20150316101323.GD52331@over-yonder.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/duOBSR7HPL.IQWZK4+m/pIr"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2015 14:22:00 -0000 --Sig_/duOBSR7HPL.IQWZK4+m/pIr Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable "Matthew D. Fuller" 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. >=20 > 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 --Sig_/duOBSR7HPL.IQWZK4+m/pIr Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlUG5hQACgkQBYqIVf93VJ0GGwCgtp+uExejVVOL42oQ068ic33F HD8Ani8TkhnAc8gSSy4A8gqBIs6a+9db =Eyev -----END PGP SIGNATURE----- --Sig_/duOBSR7HPL.IQWZK4+m/pIr--