From owner-svn-src-all@freebsd.org Wed Jul 13 10:14:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF5F9B93973; Wed, 13 Jul 2016 10:14:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78873164A; Wed, 13 Jul 2016 10:14:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6DAEaWJ008062; Wed, 13 Jul 2016 10:14:36 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6DAEaR5008060; Wed, 13 Jul 2016 10:14:36 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201607131014.u6DAEaR5008060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 13 Jul 2016 10:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r302751 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs: . zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2016 10:14:37 -0000 Author: avg Date: Wed Jul 13 10:14:36 2016 New Revision: 302751 URL: https://svnweb.freebsd.org/changeset/base/302751 Log: MFC r299946: gfs_lookup_dot() does not have to acquire any locks Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.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/gfs.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Wed Jul 13 10:13:28 2016 (r302750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Wed Jul 13 10:14:36 2016 (r302751) @@ -440,14 +440,9 @@ gfs_lookup_dot(vnode_t **vpp, vnode_t *d *vpp = dvp; return (0); } else if (strcmp(nm, "..") == 0) { - if (pvp == NULL) { - ASSERT(dvp->v_flag & VROOT); - VN_HOLD(dvp); - *vpp = dvp; - } else { - VN_HOLD(pvp); - *vpp = pvp; - } + ASSERT(pvp != NULL); + VN_HOLD(pvp); + *vpp = pvp; vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); return (0); } 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 10:13:28 2016 (r302750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Jul 13 10:14:36 2016 (r302751) @@ -973,6 +973,11 @@ zfsctl_snapdir_lookup(ap) ZFS_ENTER(zfsvfs); if (gfs_lookup_dot(vpp, dvp, zfsvfs->z_ctldir, nm) == 0) { + if (nm[0] == '.' && nm[1] == '.' && nm[2] =='\0') { + VOP_UNLOCK(dvp, 0); + VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE)); + VERIFY0(vn_lock(dvp, LK_EXCLUSIVE)); + } ZFS_EXIT(zfsvfs); return (0); } @@ -1129,6 +1134,11 @@ zfsctl_shares_lookup(ap) strlcpy(nm, cnp->cn_nameptr, cnp->cn_namelen + 1); if (gfs_lookup_dot(vpp, dvp, zfsvfs->z_ctldir, nm) == 0) { + if (nm[0] == '.' && nm[1] == '.' && nm[2] =='\0') { + VOP_UNLOCK(dvp, 0); + VERIFY0(vn_lock(*vpp, LK_EXCLUSIVE)); + VERIFY0(vn_lock(dvp, LK_EXCLUSIVE)); + } ZFS_EXIT(zfsvfs); return (0); } @@ -1467,7 +1477,6 @@ zfsctl_snapshot_inactive(ap) VERIFY(gfs_dir_lookup(vp, "..", &dvp, cr, 0, NULL, NULL) == 0); sdp = dvp->v_data; - VOP_UNLOCK(dvp, 0); if (!(locked = MUTEX_HELD(&sdp->sd_lock))) mutex_enter(&sdp->sd_lock);