Does zfs_vget() work for snapshot files?
Rick Macklem
rmacklem at uoguelph.ca
Sat Dec 14 00:57:13 UTC 2013
Jason sent me a packet capture for an NFSv4 readdir
of a .zfs/snapshot directory and the attributes
for the snapshot entries in the directory appear
like they may be bogus. They have a file type==VREG
and the same fsid as .zfs/snapshot. (If the client
does a lookup of the snapshot, the attributes of it
come back as VDIR, fileno==4 and a different fsid
than .zfs/snapshot.)
There is code in zfs_vget() that makes readdir
to switch to using VOP_LOOKUP() when the entry
in the directory is a snapshot directory, but
this doesn't appear to happen for the snapshots in
a snapshot directory. (I am wondering if VFS_VGET() somehow
gets a bogus vnode?)
Also, does anyone know if the snapshots appear
to be separate file systems with v_mountedhere
set? (They do appear to have different fsid values,
which implies a separate file system.)
If not, I may be able to do a "workaround" by
comparing the fsid of the directory being read
with the fsid of the entry, instead of depending
on v_mountedhere being non-NULL to indicate a
different file system.
Thanks in advance for any help with this, rick
More information about the freebsd-fs
mailing list