STABLE14-readdir-report-correct-inums-
20041108
FIXES 15962
We currently try fairly hard to make stat() on a volume root return the
same vnode number as is listed for the mount point by readdir(). This
behaviour is desirable; in fact, getcwd would not work otherwise.
However, we are _not_ careful about making readdir list correct inode
numbers for "." in a volume root or ".." in a directory whose parent is
a volume root. This means that applications which examine these entries
will still see inconsistent inode numbers. Clearly, it would be more
desirable to report consistent inode numbers in all cases, instead of
only in some cases.
The attached patch, written while I was tracking down some NFS
translator problems (which ultimately proved to be unrelated), makes
readdir return consistent inode numbers for volume roots. We are
running this on a few machines and have seen no problems, but it has not
been extensively tested.
(cherry picked from commit
c3d9ed3cb553747b9b317fc4794755ba98afc24b)