[BusyBox] [PATCH] eject

Rob Landley rob at landley.net
Wed May 11 22:01:47 UTC 2005


On Wednesday 11 May 2005 05:44 pm, Peter Willis wrote:

> A few points:
>
> 1. If we were really concerned about things going on 'behind our back' we'd
> probably need to check if it was mounted first and exit before any ioctl's
> were sent, otherwise who knows if an unscrupulous driver would eject the
> media before it was unmounted?

This is simply not our problem.  If the eject fails, it fails.  Woo.  If linux 
has a device driver that's capable of ejecting the device of a mounted 
filesystem, that's a kernel bug.

> 2. The 'eject' command is typically used when A. you're too lazy to unmount
> and physically eject something yourself,

Wrong, several devices aren't easy to eject manually, they're designed to do 
so in software.

> Besides, if something was using a file on the
> disk or chdir'ed into a mounted directory the filesystem wouldn't unmount
> and the disk wouldn't be ejected.

Pointing out corner cases we don't cover (and shouldn't bother to cover) is no 
excuse not to make the minimal effort to have the same behavior as the 
standard eject command, the behavior users have come to expect over the 
years.

Rob



More information about the busybox mailing list