Re: NFS mounts confuse getcwd()

Bill Hawes (whawes@star.net)
Sun, 13 Sep 1998 13:01:13 -0400


Keith Owens wrote:

> It almost needs a flag on the directory scan. One that says "just give
> me the inode number, don't try to access subdirectories until I need
> to". That would take care of disconnected NFS, AFS, external disks and
> CDs that are powered off, floppies that have been removed, etc.

It turns out that there is a simple solution, which is to change your
libc to use the new sys_getcwd() call. This just walks the dentry chain
without doing any revalidations, and will be much faster than the old
getcwd() as well. Check fs/dcache.c for details.

Apart from this, there's not much that can be done to make a traditional
getcwd() work for disconnected NFS or removed volumes -- the old-style
implementation works by reading the .. directories to look for an inode
number matching the current one.

Regards,
Bill

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/faq.html