Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jul 2015 15:01:09 -0500
From:      "Matthew D. Fuller" <fullermd@over-yonder.net>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        =?iso-8859-1?Q?Jos=E9_Garc=EDa?= Juanino <jjuanino@gmail.com>, freebsd-geom@freebsd.org
Subject:   Re: geli panics my system after suspend-resume: g_eli_orphan_spoil_assert() called for cd0.eli
Message-ID:  <20150702200109.GC50491@over-yonder.net>
In-Reply-To: <20150702094909.GA1186@garage.freebsd.pl>
References:  <CAAVO5%2BLR9MfHvt0tR5G4FyXKRt_hzkR3ZKUxvEA8Z%2BjWuEFq3g@mail.gmail.com> <20150613224602.GB1733@over-yonder.net> <CAAVO5%2BJTeZBqLZmd5t_riNmChgH8YH76DurJ_TUumFfgnVvpZg@mail.gmail.com> <20150615060128.GC1733@over-yonder.net> <20150629013011.GN50491@over-yonder.net> <20150701154233.GA1456@garage.freebsd.pl> <20150701193027.GT50491@over-yonder.net> <CAAVO5%2BK4LjjdMStpeOCDu9NH_u%2BJT48=%2BgKVycocGuuPqfUNoA@mail.gmail.com> <20150702094909.GA1186@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 02, 2015 at 11:49:10AM +0200 I heard the voice of
Pawel Jakub Dawidek, and lo! it spake thus:
> 
> With g_media_changed() we can get spoil event even if we hold
> provider exclusively open. Your patch, Matthew, is correct, but
> could you also update the comment there to take into account
> g_media_changed() addition?

Sure, you mean replacing the comment saying spoiling can't happen?
Something like:

Index: g_eli.c
===================================================================
--- g_eli.c	(revision 285057)
+++ g_eli.c	(working copy)
@@ -730,10 +730,10 @@
 	sc = malloc(sizeof(*sc), M_ELI, M_WAITOK | M_ZERO);
 	gp->start = g_eli_start;
 	/*
-	 * Spoiling cannot happen actually, because we keep provider open for
-	 * writing all the time or provider is read-only.
+	 * Spoiling can happen even though we have the provider open
+	 * exclusively, e.g. through media change events.
 	 */
-	gp->spoiled = g_eli_orphan_spoil_assert;
+	gp->spoiled = g_eli_orphan;
 	gp->orphan = g_eli_orphan;
 	gp->dumpconf = g_eli_dumpconf;
 	/*



I did leave alone the asserting on both orphan and spoil in
g_eli_read_metadata().  Since that's creating and destroying the
consumer all in one straight-line function, it makes sense to be
"impossible".  I s'pose it's possible a race with media change could
cause it to happen, but I'm willing to ignore that for now   :)


-- 
Matthew Fuller     (MF4839)   |  fullermd@over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150702200109.GC50491>