On 12/19/11 19:33, Mike Belopuhov wrote:
this is an improved diff that addresses the problem with forced
unmount of the ntfs filesystem in situations like the one described
here: http://marc.info/?l=openbsd-bugs&m=132257956328474&w=2
ntfs keeps a bunch of vnodes opened and marked as VSYSTEM including
the mount point: it's usecount is 1 and it is incremented if you do
"cd /mnt". when you pull out a usb stick and ntfs_unmount is called
it flushes all but system vnodes and then checks if system vnodes'
usecount is not more than 1 (somebody is using a vnode). in case
this is not true (and it's not true for the mount point since shell
process is holding that vnode) it returns EBUSY.
the only thing is ntfs is a read-only filesystem so there's no
real reason to not to succeed and "forceclose" all the vnodes.
the following change makes it respect the MNT_FORCE flag and proceed
even if there's someone holding a vnode. also it silences the
ntfs_reclaim (like ufs_reclaim is silenced by the prtactive).
it might not be a perfect diff, but it improves the situation by
a vast margin and still reports fs as being busy when unmount is
not forced (e.g. you run umount(1)).
This sounds great, speaking as a user of this when extracting data
from a diseased Windows disk. Thank you.
--STeve Andre'