[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#637082: #637082



On 01.11.2011 21:24, Robert Millan wrote:
> 2011/11/1 Michael Tokarev <mjt@tls.msk.ru>:
>> But whole approach - trying to canonicalize the path this way -
>> is most likely wrong.  It shouldn't be needed for the kernel
>> since it will do path resolution internally anyway during
>> mount.  And it breaks various pseudo filesystems, incl.
>> tmpfs, aufs, nfs, etc, where the device part of mount operation
>> is not really a pathname.
> 
> So let's just not canonicalize it then.  Would you like a new patch to do that?

I'm reviewing stuff for the next update of busybox.
No, I don't need a new patch - it's easy to do once
it's clear _what_ has to be done.. ;)

> (FYI, FreeBSD mount canonicalizes, but it might be gratuitous there too)

I don't see where it does that.  It canonicalizes the target directory
argument, that's for sure, but not the "spec" argument.  See
http://www.freebsd.org/cgi/cvsweb.cgi/src/sbin/mount/mount.c?rev=1.117 ,
function mountfs() -- it calls checkpath() on `name' but does not
touch `spec'.  Later in mount_fs.c:mount_fs(), it again canonicalizes
`dir' but does not touch `dev'.

The only reason to canonicalize the `device' part is to put it into
/etc/mtab "properly", but even there it is not terrible important:
if it's an object in a filesystem it may be moved or renamed or
deleted anyway, making mtab information inaccurate.

Actually I don't see a good reason to canonicalize the directory
part either, but that's a different story.

So I'll just drop this one realpath() call for the time being.

Thank you for the patience!

/mjt



Reply to: