Date: Mon, 12 May 2008 18:31:56 +0200 From: Alex Dupre <ale@FreeBSD.org> To: Andriy Gapon <avg@icyb.net.ua> Cc: freebsd-hackers@freebsd.org Subject: Re: openbsd solution to mounted umass removal Message-ID: <482870FC.5050806@FreeBSD.org> In-Reply-To: <48285372.9060103@icyb.net.ua> References: <48285372.9060103@icyb.net.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
Andriy Gapon wrote: > Filesystems on USB devices are automatically dismounted if the device is > disconnected. > > Does anybody have more [technical] details on this? Modified files: sys/dev/usb : umass.c sys/scsi : sdvar.h sd.c sys/kern : vfs_default.c vfs_subr.c Log message: Allow to pull out an usb stick with ffs filesystem while mounted and a file is written onto the stick. Without these fixes the machine panics or hangs. The usb fix calls the callback when the stick is pulled out to free the associated buffers. Otherwise we have busy buffers for ever and the automatic unmount will panic. The change in the scsi layer prevents passing down further dirty buffers to usb after the stick has been deactivated. In vfs the automatic unmount has moved from the function vgonel() to vop_generic_revoke(). Both are called when the sd device's vnode is removed. In vgonel() the VXLOCK is already held which can cause a deadlock. So call dounmount() earlier. -- Alex Dupre
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?482870FC.5050806>