Re: patch for fs/dcache race

H. Peter Anvin (hpa@transmeta.com)
13 Aug 1997 06:40:37 GMT


Followup to: <199708130210.WAA31972@mercury.cs.uml.edu>
By author: "Albert D. Cahalan" <acahalan@cs.uml.edu>
In newsgroup: linux.dev.kernel
>
> >> There are only two characters not legal in a file name
> >> in Unix, '\0' and '/'.
>
> Well actually... at the Open Group web site the Single Unix
> Specification version 2 seems to indicate otherwise.
> Portable filenames are [A-Za-z0-9_.][A-Za-z0-9_.-]*
> Enforcing that fixes the "-rf /" file in /tmp problem. :-)
>

WHOA... those are the characters that *HAVE* to exist in the filename
character set. However, *ALL* characters but / and \0 in the filename
character set *HAVE* to be legal, there is just not any requirement as
what the remaining characters map to symbol-wise.

> No way, this is not in normal filenames. This is the content
> of a magic symlink in /proc. It used to read like [0307]:1097,
> which didn't break POSIX either since /proc is not a normal
> filesystem and it has nothing to do with POSIX.

Well, there was also a context of accessing undeleted files, which
would be a nice thing to have, *done right* as opposed to the DOS
way...

> If anything, the POSIX rule makes this _better_ because the
> names mean the same thing to POSIX applications. Special Linux
> tools will know what it means and POSIX applications won't care.
> (Wait, does POSIX even have symlinks? If not, anything goes!)
>
> Another good way is to skip the leading slash. You end up with
> a "broken" symlink, which is the most correct meaning. This
> may be the best way since normal apps won't think the files
> are the same thing.

I think the current way with (deleted) is just fine for the symlinks.
It is very readable to humans.

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
Always looking for a few good BOsFH.  **  Linux - the OS of global cooperation
        I am Baha'i -- ask me about it or see http://www.bahai.org/