[BusyBox] Re: [BusyBox-cvs] svn commit: trunk/busybox: include networking

Rob Landley rob at landley.net
Sun Jul 31 03:04:08 UTC 2005


On Saturday 30 July 2005 08:37, Ladislav Michl wrote:

> > The problem you're having is there _is_ something with the filename you
> > indicated (a char device in the current directory), and mount thinks
> > that's what you're trying to use.
> >
> > Does this seem to be an accurate summary of the problem?
>
> Yes that's it. Thanks for nice summary.

Hmmm...  This is a weird corner case.  Mount's making an entirely justifiable 
assumption, it's just not what you want...

Why are you in /dev anyway?  You can't cd out of it to perform the mount?

I believe your suggestion was to only get the cannonical path if what is there 
is a file, directory, block device, or symlink to one of the above.  However, 
this could still screw you up if you're in a directory with a file named 
"mtd1" (it would try to loopback mount it.  What would jffs2 do in that 
situation, anyway?)  Or a directory named "mtd1" it would get the absolute 
path to prepare for a --bind or --move or some such.  Your fundamental 
problem is that trash in the current directory can conflict with your jffs2 
namespace, and this limits but doesn't solve it.

A better solution is to only do the cannonical path for fstab and mtab 
processing, but pass the relative path to the actual mount syscall.  I 
_think_ this should work ok, I'll have to test a few edge cases.  I can tweak 
the logic so /etc/mtab only shows the absolute path if something exists at 
that path, but not that in the case you pointed out there _is_ something at 
that path, so mtab would show jffs2 mounted at "/dev/mtd1", although this 
should be just cosmetic.  (And I can special case _that_ to only happen for 
files, directories, block devices, and symlinks, but that's getting a bit 
unnecessarily complicated.  This is busybox; we do things with _less_ strange 
corner cases if at all possible.  If you can cd out of the directory to 
perform the mount and everything works anyway, then I'm definitely going to 
minimize the amount of workarounds I do for this problem...)

>  ladis

Rob



More information about the busybox mailing list