From owner-freebsd-geom@freebsd.org Fri Jan 27 16:56:22 2017 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 CFE3BCC324E for ; Fri, 27 Jan 2017 16:56:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 055E1235 for ; Fri, 27 Jan 2017 16:56:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA04167 for ; Fri, 27 Jan 2017 18:56:14 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1cX9or-000D3S-R6 for freebsd-geom@FreeBSD.org; Fri, 27 Jan 2017 18:56:13 +0200 To: freebsd-geom@FreeBSD.org From: Andriy Gapon Subject: g_disk_done() vs a destroyed disk Message-ID: Date: Fri, 27 Jan 2017 18:55:18 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2017 16:56:22 -0000 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 being set) in g_disk_done() ? Or is it a bug that a controller driver called biodone() for that bio having earlier called disk_destroy() ? Thanks! -- Andriy Gapon