[BusyBox] Joy and Compatibility

busybox at rich-paul.net busybox at rich-paul.net
Wed Jul 27 19:17:49 UTC 2005


[[ Note:  sorry about the test message, didn't intend to send it to the
list ]]

Good question.  There are really several cases:

	1) A real partition is mounted, in which case the default behavior
		is to complain and fail, and the -c switch (is that a good
		letter? check?) behavior would be to do nothing, successfully.

	2)	A nodev partition like proc is mounted, in which case the
		default behavior is to complain and fail, and the -c switch
		would do nothing even more successfully.

	3)	A nodev partition like tmpfs is mounted, in which case the
		default behavior is the overmount, and I *THINK* that the proper
		behavior for -c would be to again do nothing and do it well.

	4)	Nothing at all is mounted, so we mount it or die trying.

	5)	Something completely differant is mounted on the requested mount
		point, and ... uhhh ... hmmm ...  Here there be tygers.
		
Speaking of odd cases, I also notice that
if I mount /proc, twice, it fails, but if I:
	mount /proc
	mount /proc -ttmpfs /proc
	mount /proc
it works just fine.  I think that's the right thing to do
though:  assume the user knows what he's trying to accomplish,
'cause I sure don't.

I wonder if the differance between cases 2 and 3 is intended.  It would
simplify things if those cases were folded.  But there might be an
excellent reason for the difference.  e.g, I remember intentionally
overmounting /dev with a fresh tmpfs, while tweaking my udevd rules. *sigh*

I guess that since util-mount and busy-mount behave the same way, the
law of least astonishment dictates leaving case three alone.

( In case anybody hasn't seen it, the law of least astonishment dictates
that a computer program should always behave in the way which will least
astonish the user. )

On Wed, Jul 27, 2005 at 02:31:26AM -0500, Rob Landley wrote:
> On Tuesday 26 July 2005 23:56, Jason Schoon wrote:
> > Totally lost here.  Are you saying a device and/or mountpoint should
> > not be allowed to be mounted multiple times?  That is very much
> > allowed and desired in many cases.
> 
> He's saying he wants an option "only perform this mount if the target mount 
> point isn't the root of some filesystem already".  The default behavior would 
> still be to overmount.
> 
> Although one thought: should the _new_ one fail, or should the _old_ one be 
> umounted instead?
> 
> Rob

-- 
Don't blame me, I voted libertarian.
http://radical-centrist.blogspot.com



More information about the busybox mailing list