From owner-svn-src-all@FreeBSD.ORG Tue Sep 14 10:27:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA813106567A; Tue, 14 Sep 2010 10:27:32 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F5688FC26; Tue, 14 Sep 2010 10:27:32 +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 o8EARWAg075672; Tue, 14 Sep 2010 10:27:32 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EARW73075670; Tue, 14 Sep 2010 10:27:32 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201009141027.o8EARW73075670@svn.freebsd.org> From: Martin Matuska Date: Tue, 14 Sep 2010 10:27:32 +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: r212605 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 14 Sep 2010 10:27:32 -0000 Author: mm Date: Tue Sep 14 10:27:32 2010 New Revision: 212605 URL: http://svn.freebsd.org/changeset/base/212605 Log: Add missing vop_vector zfsctl_ops_shares Add missing locks around VOP_READDIR and VOP_GETATTR with z_shares_dir PR: kern/150544 Approved by: delphij (mentor) Obtained from: perforce (pjd) MFC after: 1 day Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Sep 14 10:26:49 2010 (r212604) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Sep 14 10:27:32 2010 (r212605) @@ -1101,8 +1101,9 @@ zfsctl_shares_readdir(ap) return (ENOTSUP); } if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0) { + vn_lock(ZTOV(dzp), LK_SHARED | LK_RETRY); error = VOP_READDIR(ZTOV(dzp), uiop, cr, eofp, ap->a_ncookies, ap->a_cookies); - VN_RELE(ZTOV(dzp)); + VN_URELE(ZTOV(dzp)); } else { *eofp = 1; error = ENOENT; @@ -1149,6 +1150,7 @@ zfsctl_mknode_shares(vnode_t *pvp) NULL, NULL); sdp = vp->v_data; sdp->zc_cmtime = ((zfsctl_node_t *)pvp->v_data)->zc_cmtime; + VOP_UNLOCK(vp, 0); return (vp); } @@ -1176,8 +1178,9 @@ zfsctl_shares_getattr(ap) return (ENOTSUP); } if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0) { + vn_lock(ZTOV(dzp), LK_SHARED | LK_RETRY); error = VOP_GETATTR(ZTOV(dzp), vap, cr); - VN_RELE(ZTOV(dzp)); + VN_URELE(ZTOV(dzp)); } ZFS_EXIT(zfsvfs); return (error); @@ -1253,6 +1256,20 @@ static struct vop_vector zfsctl_ops_snap .vop_fid = zfsctl_common_fid, }; +static struct vop_vector zfsctl_ops_shares = { + .vop_default = &default_vnodeops, + .vop_open = zfsctl_common_open, + .vop_close = zfsctl_common_close, + .vop_ioctl = VOP_EINVAL, + .vop_getattr = zfsctl_shares_getattr, + .vop_access = zfsctl_common_access, + .vop_readdir = zfsctl_shares_readdir, + .vop_lookup = zfsctl_shares_lookup, + .vop_inactive = gfs_vop_inactive, + .vop_reclaim = zfsctl_common_reclaim, + .vop_fid = zfsctl_shares_fid, +}; + /* * pvp is the GFS vnode '.zfs/snapshot'. *