Unable to pwd in ZFS snapshot

Robert Watson rwatson at FreeBSD.org
Mon Feb 9 09:56:17 PST 2009

On Mon, 9 Feb 2009, Jaakko Heinonen wrote:

> On 2009-02-08, Peter Jeremy wrote:
>> I'm running -current from late last year (just after the ZFS v13 import) 
>> and have found that I can't determine the current working directory inside 
>> a snapshot:
> getcwd(3) first tries __getcwd() system call but it always fails because the 
> VFS name cache is not supported for .zfs control directories. Secondly 
> getcwd(3) tries to resolve working directory by traversing the directory 
> tree to root but this fails too because the .zfs directory is normally 
> hidden from the directory listing. (getcwd(3) uses readdir(3) to find 
> component names)

Now that we have a new VOP to assist in reverse-name resolution, it could be 
that ZFS could provide the back-end lookup to address this issue without 
forcing the use of the namecache for things we don't want to cache.

Robert N M Watson
Computer Laboratory
University of Cambridge

More information about the freebsd-fs mailing list