From owner-freebsd-geom@freebsd.org Mon Jan 30 09:34:14 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 0A442CC688C for ; Mon, 30 Jan 2017 09:34:14 +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 601B423D for ; Mon, 30 Jan 2017 09:34:12 +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 LAA12106; Mon, 30 Jan 2017 11:34:04 +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 1cY8Lc-000HKI-Bo; Mon, 30 Jan 2017 11:34:04 +0200 Subject: Re: g_disk_done() vs a destroyed disk To: Poul-Henning Kamp , freebsd-geom@FreeBSD.org References: <31395.1485554104@critter.freebsd.dk> <8de79017-f0b0-c86a-93c5-65be4d97b21c@FreeBSD.org> <33960.1485609820@critter.freebsd.dk> From: Andriy Gapon Message-ID: <8d0093d9-759b-7674-650d-4caff1bc29a6@FreeBSD.org> Date: Mon, 30 Jan 2017 11:33:08 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <33960.1485609820@critter.freebsd.dk> Content-Type: text/plain; charset=windows-1252 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: Mon, 30 Jan 2017 09:34:14 -0000 On 28/01/2017 15:23, Poul-Henning Kamp wrote: > -------- > In message <8de79017-f0b0-c86a-93c5-65be4d97b21c@FreeBSD.org>, Andriy Gapon wri > tes: > >> So, the correct sequence should be: >> - call disk_gone() to prevent new I/O >> - handle all in-flight I/O >> - call disk_destroy() >> Is that right? > > exactly! Thank you! And, just in case, I am seeing this problem with mfi driver. It uses disk(9) API directly to represent disks behind the controller. It seems that we have a class of such drivers and probably all of them are affected. Here is a list of files where I see disk_destroy, but no disk_gone: /usr/src/sys/dev/mlx/mlx_disk.c /usr/src/sys/dev/aac/aac_disk.c /usr/src/sys/dev/twe/twe_freebsd.c /usr/src/sys/dev/ips/ips_disk.c /usr/src/sys/dev/ida/ida_disk.c /usr/src/sys/dev/mfi/mfi_syspd.c /usr/src/sys/dev/mfi/mfi_disk.c /usr/src/sys/dev/cfi/cfi_disk.c /usr/src/sys/dev/amr/amr_disk.c The list is not complete. -- Andriy Gapon