From owner-freebsd-geom@FreeBSD.ORG Sat Jun 13 22:46:11 2015 Return-Path: Delivered-To: freebsd-geom@hub.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 D8E80CFD; Sat, 13 Jun 2015 22:46:11 +0000 (UTC) (envelope-from fullermd@over-yonder.net) 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 B15055ED; Sat, 13 Jun 2015 22:46:11 +0000 (UTC) (envelope-from fullermd@over-yonder.net) 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 BF44137B5E6; Sat, 13 Jun 2015 17:46:03 -0500 (CDT) Received: by draco.over-yonder.net (Postfix, from userid 100) id 3m8DY70QH5z1bZ; Sat, 13 Jun 2015 17:46:03 -0500 (CDT) Date: Sat, 13 Jun 2015 17:46:03 -0500 From: "Matthew D. Fuller" To: =?iso-8859-1?Q?Jos=E9_Garc=EDa?= Juanino Cc: freebsd-geom@freebsd.org Subject: Re: geli panics my system after suspend-resume: g_eli_orphan_spoil_assert() called for cd0.eli Message-ID: <20150613224602.GB1733@over-yonder.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.5.23-fullermd.4 (2014-03-12) X-Virus-Scanned: clamav-milter 0.98.7 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: Sat, 13 Jun 2015 22:46:12 -0000 [ Redirect to -geom, bcc'd to -current for transition ] On Sat, Jun 13, 2015 at 04:10:38PM +0200 I heard the voice of José García Juanino, and lo! it spake thus: > Hi FreeBSD current, > > I get a reproducible panic following these steps: > > 1- Mount a geli encrypted DVD: [...] > 4- Open again the lid a wait. The system resumes, but panics after a > few seconds: > > panic: Function g_eli_orphan_spoil_assert() called for cd0.eli. This is presumably what's hooked up in g_eli_create(): /* * Spoiling cannot happen actually, because we keep provider open for * writing all the time or provider is read-only. */ gp->spoiled = g_eli_orphan_spoil_assert; The backtrace makes me think that coming out of resume will cause a media change event on the cd0 device, which sounds a _little_ odd, but may be necessary due to Stupid Reality Crap. That pushes a spoil event down to g_eli. And g_eli seems to assume that can't happen to a thing it's got around an open. With the caveat that I'm no expert on ELI or GEOM, and any advice I might give could just be the trigger for a nasal demon invasion of our world, one thing you might try is taking that event as a hint to just blow away the .eli device; treat it like an orphan. So changing that callback to using the g_eli_orphan func instead. e.g., something like Index: g_eli.c =================================================================== --- g_eli.c (revision 284359) +++ g_eli.c (working copy) @@ -730,7 +730,7 @@ g_eli_create(struct gctl_req *req, struct g_class * Spoiling cannot happen actually, because we keep provider open for * writing all the time or provider is read-only. */ - gp->spoiled = g_eli_orphan_spoil_assert; + gp->spoiled = g_eli_orphan; gp->orphan = g_eli_orphan; gp->dumpconf = g_eli_dumpconf; /* (not even remotely tested; beware of leopard) -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream.