From owner-freebsd-arch@FreeBSD.ORG Mon Sep 13 17:28:04 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3957516A50B for ; Mon, 13 Sep 2004 17:28:04 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA07343D2F for ; Mon, 13 Sep 2004 17:28:03 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.0.11] (junior-wifi.samsco.home [192.168.0.11]) (authenticated bits=0) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id i8DHT0fc029634; Mon, 13 Sep 2004 11:29:00 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4145D7E8.9040209@samsco.org> Date: Mon, 13 Sep 2004 11:24:56 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040831 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sam References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org cc: freebsd-arch@freebsd.org Subject: Re: 4.x device failure? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2004 17:28:04 -0000 Sam wrote: > Hello, > > I'm testing out my AoE driver and have a question about > how to handle device failure. I have a function, > aoedev_down, that fails all outstanding bufs and if the > device is currently open, calls disk_invalidate and flags > the device for destruction on close. This function > is also called on module unload, once per device. The > module unload will wait until all devices are closed > before returning. > > The test I'm running is to mount an AoE device and unload > the AoE module. The mount persists (while AoE unload > waits) and upon umount I get a panic and eventual hang > syncing disks. I would have thought that calling > disk_invalidate would cause anyone depending on that > disk to see it as gone, but that's apparently not so. > I never see the close. > > Surely there's a way to pull a disk out from under > those that have it open without a panic? Opinions? > > Cheers, > > Sam > Are you calling disk_destroy()? disk_invalidate() only frees the disk slice objects, it doesn't actually remove the disk object and cdevsw. You also need to manually track opens in your disk driver and only call disk_destroy() once all references are closed. What panic are you getting? Scott