svn commit: r302739 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Andriy Gapon avg at FreeBSD.org
Wed Jul 13 09:48:06 UTC 2016


Author: avg
Date: Wed Jul 13 09:48:04 2016
New Revision: 302739
URL: https://svnweb.freebsd.org/changeset/base/302739

Log:
  MFC r299908,300131,301275: zfs: set VROOT / VV_ROOT consistently and in
  a single place

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c	Wed Jul 13 09:47:54 2016	(r302738)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c	Wed Jul 13 09:48:04 2016	(r302739)
@@ -1013,13 +1013,6 @@ zfsctl_snapdir_lookup(ap)
 			 */
 			VERIFY(zfsctl_snapshot_zname(dvp, nm, MAXNAMELEN, snapname) == 0);
 			goto domount;
-		} else {
-			/*
-			 * VROOT was set during the traverse call.  We need
-			 * to clear it since we're pretending to be part
-			 * of our parent's vfs.
-			 */
-			(*vpp)->v_flag &= ~VROOT;
 		}
 		mutex_exit(&sdp->sd_lock);
 		ZFS_EXIT(zfsvfs);

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Wed Jul 13 09:47:54 2016	(r302738)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Wed Jul 13 09:48:04 2016	(r302739)
@@ -1826,11 +1826,8 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t
 
 	ZFS_EXIT(zfsvfs);
 
-	if (error == 0) {
+	if (error == 0)
 		error = vn_lock(*vpp, flags);
-		if (error == 0)
-			(*vpp)->v_vflag |= VV_ROOT;
-	}
 	if (error != 0)
 		*vpp = NULL;
 

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Wed Jul 13 09:47:54 2016	(r302738)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Wed Jul 13 09:48:04 2016	(r302739)
@@ -572,9 +572,10 @@ zfs_znode_sa_init(zfsvfs_t *zfsvfs, znod
 	zp->z_is_sa = (obj_type == DMU_OT_SA) ? B_TRUE : B_FALSE;
 
 	/*
-	 * Slap on VROOT if we are the root znode
+	 * Slap on VROOT if we are the root znode unless we are the root
+	 * node of a snapshot mounted under .zfs.
 	 */
-	if (zp->z_id == zfsvfs->z_root)
+	if (zp->z_id == zfsvfs->z_root && zfsvfs->z_parent == zfsvfs)
 		ZTOV(zp)->v_flag |= VROOT;
 
 	mutex_exit(&zp->z_lock);


More information about the svn-src-stable-9 mailing list