Unable to pwd in ZFS snapshot

Jaakko Heinonen jh at saunalahti.fi
Tue Feb 10 08:52:10 PST 2009


On 2009-02-09, Robert Watson wrote:
> 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.

I think that a bigger problem is how __getcwd() works. If single path
component lookup fails from cache or with VOP_VPTOCNP __getwcd() will
abort. So even if ZFS supported VOP_VPTOCNP perfectly some path
components may be on a file system which doesn't and the hidden ".zfs"
prevents userspace traversal from succeeding.

Actually ZFS caches the hidden ".zfs" directory (but nothing below it).
Thus if __getcwd() reverted to readdir scan only for those components
which really require it getcwd(3) should work right now (as long as
".zfs" is in cache).

Looks like someone has tried to do this already:


The patch doesn't apply against head anymore.


More information about the freebsd-fs mailing list