geli panics my system after suspend-resume: g_eli_orphan_spoil_assert() called for cd0.eli

José García Juanino jjuanino at gmail.com
Sun Jun 14 18:51:11 UTC 2015


On 14 June 2015 at 00:46, Matthew D. Fuller <fullermd at over-yonder.net> wrote:

> 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:
>
> 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;
>         /*
>

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


More information about the freebsd-geom mailing list