Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jun 2015 20:51:08 +0200
From:      =?UTF-8?B?Sm9zw6kgR2FyY8OtYSBKdWFuaW5v?= <jjuanino@gmail.com>
To:        "Matthew D. Fuller" <fullermd@over-yonder.net>
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:  <CAAVO5%2BJTeZBqLZmd5t_riNmChgH8YH76DurJ_TUumFfgnVvpZg@mail.gmail.com>
In-Reply-To: <20150613224602.GB1733@over-yonder.net>
References:  <CAAVO5%2BLR9MfHvt0tR5G4FyXKRt_hzkR3ZKUxvEA8Z%2BjWuEFq3g@mail.gmail.com> <20150613224602.GB1733@over-yonder.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 14 June 2015 at 00:46, Matthew D. Fuller <fullermd@over-yonder.net> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAVO5%2BJTeZBqLZmd5t_riNmChgH8YH76DurJ_TUumFfgnVvpZg>