From owner-svn-src-head@FreeBSD.ORG Sun Sep 13 21:40:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD092106566B; Sun, 13 Sep 2009 21:40:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B5908FC16; Sun, 13 Sep 2009 21:40:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DLeagr032459; Sun, 13 Sep 2009 21:40:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DLea7x032457; Sun, 13 Sep 2009 21:40:36 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200909132140.n8DLea7x032457@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 13 Sep 2009 21:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197177 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 21:40:36 -0000 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;