From owner-freebsd-geom@FreeBSD.ORG Sun May 3 13:26:06 2015 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CA3839D for ; Sun, 3 May 2015 13:26:06 +0000 (UTC) Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.31.42]) (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 4C5821D3B for ; Sun, 3 May 2015 13:26:05 +0000 (UTC) Received: from [78.35.152.57] (helo=fabiankeil.de) by smtprelay04.ispgateway.de with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1Yotth-0001C6-BY for freebsd-geom@freebsd.org; Sun, 03 May 2015 15:25:29 +0200 Date: Sun, 3 May 2015 15:25:30 +0200 From: Fabian Keil To: freebsd-geom@freebsd.org Subject: Re: RFC: Pass TRIM through GELI Message-ID: <4ea2ed80.2a96d87b@fabiankeil.de> In-Reply-To: <20150502125220.GS78376@over-yonder.net> References: <20150308000131.GP1742@over-yonder.net> <20150324021924.GQ52331@over-yonder.net> <20150502125220.GS78376@over-yonder.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/RpoQitGx4XCoN6_WSiPH6Dn"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 13:26:06 -0000 --Sig_/RpoQitGx4XCoN6_WSiPH6Dn Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable "Matthew D. Fuller" wrote: > > > But that lack of checking is a Real Bug by itself anyway, so merits > > > a fix. > > Stuffed into bugzilla as > > >=20 > [...] >=20 > > After last round, everybody seems happy enough with this, so I've > > filed it as > > . >=20 > 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_clas= s *mp) gctl_error(req, "No '%s' argument.", "detach"); return; } + trim =3D gctl_get_paraml(req, "trim", sizeof(*trim)); + if (trim =3D=3D NULL) { + gctl_error(req, "No '%s' argument.", "trim"); + return; + } This patch fixes this: https://www.fabiankeil.de/sourcecode/electrobsd/geli-Accept-onetime-request= s-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 --Sig_/RpoQitGx4XCoN6_WSiPH6Dn Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlVGIcoACgkQBYqIVf93VJ0svgCeKpestshlTio+lyYgJf/2ri1x vdEAn29tq3/Ir4utHFR+OtLv7sbM/9iP =xc8e -----END PGP SIGNATURE----- --Sig_/RpoQitGx4XCoN6_WSiPH6Dn-- From owner-freebsd-geom@FreeBSD.ORG Mon May 4 15:01:50 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 1E2BF78F for ; Mon, 4 May 2015 15:01:50 +0000 (UTC) Received: from thyme.infocus-llc.com (thyme.infocus-llc.com [199.15.120.10]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED41019CF for ; Mon, 4 May 2015 15:01:49 +0000 (UTC) Received: from draco.over-yonder.net (c-75-65-60-66.hsd1.ms.comcast.net [75.65.60.66]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by thyme.infocus-llc.com (Postfix) with ESMTPSA id 346E337B593; Mon, 4 May 2015 10:01:42 -0500 (CDT) Received: by draco.over-yonder.net (Postfix, from userid 100) id 3lgS7n4xSRz210; Mon, 4 May 2015 10:01:41 -0500 (CDT) Date: Mon, 4 May 2015 10:01:41 -0500 From: "Matthew D. Fuller" To: Fabian Keil Cc: freebsd-geom@freebsd.org Subject: Re: RFC: Pass TRIM through GELI Message-ID: <20150504150141.GV78376@over-yonder.net> References: <20150308000131.GP1742@over-yonder.net> <20150324021924.GQ52331@over-yonder.net> <20150502125220.GS78376@over-yonder.net> <4ea2ed80.2a96d87b@fabiankeil.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ea2ed80.2a96d87b@fabiankeil.de> X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.5.23-fullermd.4 (2014-03-12) X-Virus-Scanned: clamav-milter 0.98.6 at thyme.infocus-llc.com X-Virus-Status: Clean X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 15:01:50 -0000 On Sun, May 03, 2015 at 03:25:30PM +0200 I heard the voice of Fabian Keil, and lo! it spake thus: > > One minor issue I ran into is that a patched kernel will reject > onetime requests from an unpatched userland: > [...] > The culprit is: Interesting. Sounds reasonable enough. Should probably pull out the 'detach' handling similarly... -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream.