Subject: Re: detachable device: stuck in biowait
To: Ferry Sutanto <firstname.lastname@example.org>
From: Jaromir Dolecek <email@example.com>
Date: 01/26/2002 11:54:29
At the very least, the filesystem is marked dirty when mounted,
and kernel tries to mark in clean on umount. If the device is gone
by then, this would sure block forever.
A solution is to always unmount the filesystem
before detaching the device.
Ferry Sutanto wrote:
> Netbsd kernel gurus ...
> I have hot-swappable compact flash mounted with FFS
> with MNT_SYNCHRONOUS flag in my system. If I pull out
> the compact flash during FTP session (doing a get),
> the NetBSD kernel would do crazy stuff. I have put
> some code in and I am down to 1 issue where the write
> system call would wait forever because the kernel
> calls biowait() function (in kern/vfs_bio.c) and in
> that code, it calls for tsleep. And since the device
> is gone, no interrupt would come and and wakeup the
> sleep. I put some hacked in to wake up the sleep by
> calling biodone(), but it doesn't work.
> Does anybody have that experience ?? Is there any
> sample code I can look at ?
> Do You Yahoo!?
> Great stuff seeking new owners in Yahoo! Auctions!
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/Ports/i386/ps2.html
-= Those who would give up liberty for a little temporary safety deserve =-
-= neither liberty nor safety, and will lose both. -- Benjamin Franklin =-