Date: Fri, 27 Jan 2017 21:55:04 +0000 From: "Poul-Henning Kamp" <phk@phk.freebsd.dk> To: Andriy Gapon <avg@FreeBSD.org> Cc: freebsd-geom@FreeBSD.org Subject: Re: g_disk_done() vs a destroyed disk Message-ID: <31395.1485554104@critter.freebsd.dk> In-Reply-To: <cba9c9bf-97ad-e3ae-e209-ea91e49b5822@FreeBSD.org> References: <cba9c9bf-97ad-e3ae-e209-ea91e49b5822@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
-------- In message <cba9c9bf-97ad-e3ae-e209-ea91e49b5822@FreeBSD.org>, Andriy Gapo= n writes: > >I've seen a situation where g_disk_done() was called on a bio after the >corresponding disk had been already destroyed via g_disk_destroy(). >That call resulted in a crash here: > devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now); >because sc->dp was NULL. > >Is it a bug that we do not check for dp being NULL (or dp->d_destroyed be= ing >set) in g_disk_done() ? >Or is it a bug that a controller driver called biodone() for that bio hav= ing >earlier called disk_destroy() ? It is a driver bug to call disk_destroy() before purging all in-flight bio= s with biodone() -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= .
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31395.1485554104>