Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Sep 2009 21:40:36 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r197177 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <200909132140.n8DLea7x032457@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Sun Sep 13 21:40:36 2009
New Revision: 197177
URL: http://svn.freebsd.org/changeset/base/197177

Log:
  Support both case: when snapshot is already mounted and when it is not yet
  mounted.
  
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Sun Sep 13 21:30:18 2009	(r197176)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Sun Sep 13 21:40:36 2009	(r197177)
@@ -1182,11 +1182,10 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno
 	ZFS_ENTER(zfsvfs);
 
 	/*
-	 * On FreeBSD we are already called with snapshot's mount point
-	 * and not the mount point of its parent.
+	 * On FreeBSD we can get snapshot's mount point or its parent file
+	 * system mount point depending if snapshot is already mounted or not.
 	 */
-#ifndef __FreeBSD__
-	if (fidp->fid_len == LONG_FID_LEN) {
+	if (zfsvfs->z_parent == zfsvfs && fidp->fid_len == LONG_FID_LEN) {
 		zfid_long_t	*zlfid = (zfid_long_t *)fidp;
 		uint64_t	objsetid = 0;
 		uint64_t	setgen = 0;
@@ -1204,7 +1203,6 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno
 			return (EINVAL);
 		ZFS_ENTER(zfsvfs);
 	}
-#endif
 
 	if (fidp->fid_len == SHORT_FID_LEN || fidp->fid_len == LONG_FID_LEN) {
 		zfid_short_t	*zfid = (zfid_short_t *)fidp;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909132140.n8DLea7x032457>