Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Sep 2004 11:24:56 -0600
From:      Scott Long <scottl@samsco.org>
To:        Sam <sah@softcardsystems.com>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: 4.x device failure?
Message-ID:  <4145D7E8.9040209@samsco.org>
In-Reply-To: <Pine.LNX.4.60.0409131202270.6275@athena>
References:  <Pine.LNX.4.60.0409131202270.6275@athena>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4145D7E8.9040209>