Re: patch for fs/dcache race

Ingo Molnar (mingo@pc7537.hil.siemens.at)
Wed, 13 Aug 1997 10:32:16 +0200 (MET DST)


On 13 Aug 1997, H. Peter Anvin wrote:

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

the rules are so simple if we define 'components', and allow _zero_
components too. Components are separated by '/'.

'/////////////xxx' means: alot of zero components, plus the "xxx"
component. No 'slash after slash', just components.

A 'full' pathname is a pathname that starts with a zero component.

Components form a tree, a series of components identifies a node in the
tree. These are the rules to identify a node in the tree:

"" and "." are identity
".." means down in the tree
anything else means up in the tree

user-supplied component-series are _always_ relative to some node in the
tree. If the first component is a zero component, then the starting point
is current->fs->root, otherwise it's current->cwd.

The Posix '//' thing can be considered a serious and pointless hack ... we
can do everything with the above scheme already.

-- mingo