From owner-freebsd-geom@FreeBSD.ORG Sun Jun 14 18:51:10 2015 Return-Path: Delivered-To: freebsd-geom@hub.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 D1C669B7 for ; Sun, 14 Jun 2015 18:51:10 +0000 (UTC) (envelope-from jjuanino@gmail.com) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 699FE9E1 for ; Sun, 14 Jun 2015 18:51:10 +0000 (UTC) (envelope-from jjuanino@gmail.com) Received: by wgzl5 with SMTP id l5so28951324wgz.3 for ; Sun, 14 Jun 2015 11:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=pZiWHisMYkvIBV0aLH3DwVsPyph64aflBxi+Hk2AtCo=; b=0p5otm3bK6QY+CnhJZCALI8i/dIXej7kdK2QjNhPARN9zouYJ8tv3h056DJKg7cb+L GfmT9hSiaXxMzDXvh0B0jkHixmx5ObtzDwGZ1vFXOsUE8+KLER/nBMPYKWWDtPlLNtIb zsvSKt5fiCN9uTuf7kHSGlYLMSjF0Z7c4S71K3t8aXH/BvVBefApuKjxWwD+MI60L3YV jkCSP50szlae6dQjAFXAPn9MDAQ/4p8jBjNYhGZjqClWr/laOG7Ap6ZGCYKYjuyqsA7i l5bc2iA9qrHIbsY0ePk0QkYiJ/OJX99pOY/HFdD07BT/HdiA1DMn833d8IbA4pjcZqOd KO6Q== MIME-Version: 1.0 X-Received: by 10.180.109.136 with SMTP id hs8mr24726094wib.73.1434307868795; Sun, 14 Jun 2015 11:51:08 -0700 (PDT) Received: by 10.194.74.167 with HTTP; Sun, 14 Jun 2015 11:51:08 -0700 (PDT) In-Reply-To: <20150613224602.GB1733@over-yonder.net> References: <20150613224602.GB1733@over-yonder.net> Date: Sun, 14 Jun 2015 20:51:08 +0200 Message-ID: Subject: Re: geli panics my system after suspend-resume: g_eli_orphan_spoil_assert() called for cd0.eli From: =?UTF-8?B?Sm9zw6kgR2FyY8OtYSBKdWFuaW5v?= To: "Matthew D. Fuller" Cc: freebsd-geom@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, 14 Jun 2015 18:51:11 -0000 On 14 June 2015 at 00:46, Matthew D. Fuller wrot= e: > On Sat, Jun 13, 2015 at 04:10:38PM +0200 I heard the voice of > Jos=C3=A9 Garc=C3=ADa Juanino, and lo! it spake thus: >> Hi FreeBSD current, >> >> I get a reproducible panic following these steps: >> >> 1- Mount a geli encrypted DVD: > > 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 =3D 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 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- 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 =3D g_eli_orphan_spoil_assert; > + gp->spoiled =3D g_eli_orphan; > gp->orphan =3D g_eli_orphan; > gp->dumpconf =3D g_eli_dumpconf; > /* > Thanks for your response. I have tried your patch and works. At least, the laptop does not panic. But after resume, the geli device is destroyed: Jun 14 20:29:32 abel kernel: GEOM_ELI: Device cd0.eli destroyed. Jun 14 20:29:32 abel kernel: GEOM_ELI: Detached cd0.eli on last close. The /cdrom filesystem remains mounted, but it is unusable. It is needed to remount, attaching again the encrypted DVD. By the other hand, I have not tested if this issue is limited to removable media as CD-ROMs o DVDs. Regards