I have installed on sources a new /sys/src/9/port/chan.c
with a new dot-dot algorithm.  This time for sure!

The old struct Cname is replaced by struct Path, which contains
the name as Cname did, but also an array Chan *mtpt[] giving
all the mount points crossed during construction of the path.
If you're in /n/dump/2005/0913, 
    mtpt[] = { nil, Chan(/n), Chan(/n/dump), nil, nil }
where Chan(x) is a Chan corresponding to the directory x.
Paths are maintained during namec just like Cnames were,
with the addition that addelem and domount update mtpt[]
as necessary.  Undomount, which used to consult the current
name space, now consults the last element of the mtpt[] array.  

The effect is that dot-dot should be much more robust.  
If your file server fails to return the correct root qid when
someone dot-dots up to its root, the kernel will still find its
way back out to the left side of the mount point after the
appropriate number of dot-dots: mtpt determines whether
there is a mount point to cross, not the qid.

Similarly, the clever sequence that Sergey Reva discovered 
back in December works as expected: even though the name
space has been changed, the dot-dots return the left sides of
the mount points crossed, not the current mount points.

I have not installed new kernels on sources, but I will next week,
once we've been running the new code inside Bell Labs for a
little while.  The new source is on sources so you can try it out
yourself if you are interested.

Enjoy.
Russ

Reply via email to