vn_fullpath() again

Dag-Erling Smørgrav des at des.no
Tue Sep 6 08:05:56 PDT 2005


Igor Shmukler <shmukler at mail.ru> writes:
> Dag-Erling Smørgrav <des at des.no> writes:
> > Igor Shmukler <shmukler at mail.ru> writes:
> > > You are correct about the Unix file system organization, but does it
> > > mean reliable vnode to fullname conversation is not possible?
> > Yes.  Get over it.
> Well, I do not think it is a Yes. I very much think it is a No. You
> should have continued reading my email 'til the middle or even
> farther.

I did.  You just don't get it.  A file may be associated with zero,
one or more names and none of these names are more correct or
authoritative than any of the others.  If a user does 'ln /bin/ls
/tmp' (assuming /bin and /tmp are on the same filesystem), it may be
obvious to you that /bin/ls is the "real name" is /tmp/ls is just an
alias, but it is not obvious to the kernel.  In fact, the kernel is
unable to see any difference at all between these two names.

Storing the name that was used to access a file in the vnode does not
solve anything, because the vnode is shared by all users of that file,
regardless of which name they used to access it, and there is no
guarantee that the name that was used to access a file two seconds ago
still references the same file, or any file at all; the file may have
been renamed or deleted, or a new filesystem may have been mounted
that covers the namespace that file was in.

In summary: THERE IS NO WAY TO UNIQUELY AND RELIABLY MAP A VNODE BACK
TO A NAME, and I wish people would stop insisting that there must be.
All the world is not MS-DOS.

DES
-- 
Dag-Erling Smørgrav - des at des.no



More information about the freebsd-hackers mailing list