[BusyBox] One more #*%(&#% umount corner case.
Rob Landley
rob at landley.net
Fri Aug 5 23:20:21 UTC 2005
On Friday 05 August 2005 17:29, Rob Landley wrote:
> Now, even in that case it shouldn't cause a problem. If it's not there the
> syscall should fail even if our mtab checking logic still thinks it's there
> the second time. But how about this one?
>
> mount -t ramfs /thingy
> mount /dev/ram0 /thingy
> umount /dev/ram0 /dev/ram0
>
> Because umounts of block devices are (where possible) converted into
> umounts of the corresponding directories (which is the only way to make the
> "umount all instances of this block device" logic work; iterate through all
> of them),
It's not the only way: if you feed the block device to the syscall the kernel
will umount the most recent occurrence itself, so if block devices aren't
translated even this corner case can be made to work.
Although I still have to add a test for this. After dinner, I think.
My mount rewrite is once again compiling. I still need to update the usage
for the new command line arguments (umount -d is now the default, and -D has
been added to _not_ do that. And umount -l will now lazy umount. And umount
-f is now small enough it's not optional anymore, but I need to update the
config to yank out that option. And no, it shouldn't be optional because
"old kernels don't support it", either. I've isolated the header
dependencies (hard wired in the constants with comments about what they came
from) and the umount2 syscall itself was added during 2.1 so it should work
on any kernel we remotely care about...)
Lots of testing and polishing still needed, but no more cans o' worms: it's
finally feature complete. (And I'm tired...)
Rob
More information about the busybox
mailing list