From owner-freebsd-geom@freebsd.org Thu Jul 2 20:01:18 2015 Return-Path: Delivered-To: freebsd-geom@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03C5F993D16 for ; Thu, 2 Jul 2015 20:01:18 +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 D1F521B89; Thu, 2 Jul 2015 20:01:17 +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 667F837B567; Thu, 2 Jul 2015 15:01:10 -0500 (CDT) Received: by draco.over-yonder.net (Postfix, from userid 100) id 3mMr0563gFz1fH; Thu, 2 Jul 2015 15:01:09 -0500 (CDT) Date: Thu, 2 Jul 2015 15:01:09 -0500 From: "Matthew D. Fuller" To: Pawel Jakub Dawidek Cc: =?iso-8859-1?Q?Jos=E9_Garc=EDa?= Juanino , 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> References: <20150613224602.GB1733@over-yonder.net> <20150615060128.GC1733@over-yonder.net> <20150629013011.GN50491@over-yonder.net> <20150701154233.GA1456@garage.freebsd.pl> <20150701193027.GT50491@over-yonder.net> <20150702094909.GA1186@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150702094909.GA1186@garage.freebsd.pl> 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: Thu, 02 Jul 2015 20:01:18 -0000 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.