]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
zfs: set VROOT / VV_ROOT consistently and in a single place
authoravg <avg@FreeBSD.org>
Fri, 3 Jun 2016 14:37:18 +0000 (14:37 +0000)
committeravg <avg@FreeBSD.org>
Fri, 3 Jun 2016 14:37:18 +0000 (14:37 +0000)
commit3184a6cb731f764b0552a4901ca4f95ee41f6536
tree3872110afaca45f22f0fbe97d0b0dd2a77983803
parentc46e1b80b9c6160967bf2db2289a277529a4d2ad
zfs: set VROOT / VV_ROOT consistently and in a single place

This is a followup to r300131.

A filesystem's root vnode can be reached not only through VSF_ROOT, but
by other means as well.  For example, via a dot-dot lookup.
Also, a root vnode can get reclaimed and then re-created.  For these
reasons it was insufficient to clear VV_ROOT flag from a root vnode of a
snapshot mounted under .zfs in zfsctl_snapdir_lookup().

So, now we set the flag in zfs_znode_sa_init() only if a vnode
represent a root of a filesystem or a standalone snapshot.
That is, the flag is not set for snapshots mounted under .zfs.

MFC after: 2 weeks
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c