Unable to pwd in ZFS snapshot
gleb.kurtsou at gmail.com
Sun Feb 14 10:30:11 UTC 2010
On (14/02/2010 10:49), Jaakko Heinonen wrote:
> On 2010-02-14, Gleb Kurtsou wrote:
> > problem here lies in incorrect inode numbers (inconsistency between
> > VOP_READDIR and VOP_GETATTR).
> It's normal for mount points. This is problem for kernel
> vn_fullpath1()/vop_stdvptocnp() because ZFS clears VV_ROOT for snapshot
> root vnodes but I don't see this causing a problem in user space.
> > Fixing it only in kernel (__getcwd) doesn't necessarily fixes it for
> > all cases in userland, getcwd in our libc falls back to comparing
> > inode numbers
> User space getcwd() works just fine if the .zfs directory is visible (or
> am I missing something?). See the code in getcwd.c under comment "If
> it's a mount point, have to stat each element because the inode number
> in the directory is for the entry in the parent directory, not the inode
> number of the mounted file."
Ah, now i see it. Sorry for extra noise.
> User space getcwd() just can't work for hidden directories.
> > Fixing inode numbers would also fix pwd issues with namecache disabled.
> I don't think so. If the .zfs directory is hidden, vop_stdvptocnp() and
> user space getcwd() don't work.
More information about the freebsd-fs