Re: patch for fs/dcache race

H. Peter Anvin (hpa@transmeta.com)
12 Aug 1997 21:48:54 GMT


Followup to: <9708122052.AA17214@nyx.net>
By author: colin@nyx.net (Colin Plumb)
In newsgroup: linux.dev.kernel
>
> There are only two characters not legal in a file name in Unix,
> '\0' and '/'. Perhaps some simple scheme like doubling the
> slash before deleted names would be less ambiguous?
>
> E.g.
>
> /foo//bar//baz
>
> Means that "bar" and "baz" are deleted, but not "foo".
> Compare with /foo/bar//baz, where nothing has happened to the
> parent directory.
>
> Or is that overloading too heavily used anyway? Or doesn't anyone care
> if it's ambiguous?
>

It breaks POSIX, and a helluva lot of tools. Unix has the "multiple
slash rule", which says that multiple slashes are treated as one (in
fact, traditional Unices treat // as /./) and a final slash like a
final slash-dot.

POSIX does allow for one exception to the multiple slash rule: exactly
two slashes at the beginning may be used to escape to a higher
namespace. Also /.. is allowed to escape to a higher namespace.
Both, however, are bad ideas, as a lot of traditional Unix tools
assume that /.. == / and // == /.

An undelete utility also needs to take into account multiple
generations of a file, which may all have the same name. The only
commonly used syntax for that is <filename>;version -- presumably if
there is no version you are talking the "current" (i.e. not deleted)
version. This would not be a part of the standard Linux filename
resolution, but could be used by a special set of system calls related
to undeletion of files. They would have to provide for some mechanism
to escape the semicolon (maybe ; -> ;;) if a filename does actually
contain one.

-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/