From owner-svn-src-head@FreeBSD.ORG Sat Dec 1 18:12:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 219BB240; Sat, 1 Dec 2012 18:12:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E17F78FC14; Sat, 1 Dec 2012 18:12:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB1ICtP1063720; Sat, 1 Dec 2012 18:12:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB1ICt7O063719; Sat, 1 Dec 2012 18:12:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201212011812.qB1ICt7O063719@svn.freebsd.org> From: Andriy Gapon Date: Sat, 1 Dec 2012 18:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243762 - head/sys/cddl/contrib/opensolaris/uts/common/fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 01 Dec 2012 18:12:56 -0000 Author: avg Date: Sat Dec 1 18:12:55 2012 New Revision: 243762 URL: http://svnweb.freebsd.org/changeset/base/243762 Log: gfs_file_inactive: replace bad code with ugly code Also, make it explicit that V_XATTRDIR is not properly supported in gfs code yet. The bad code was plain incorrect: (a) it spoiled handling of v_usecount reaching zero and (b) it leaked v_holdcnt. The ugly code employs potentially unsafe locking tricks. Ideally we should separate vnode lifecycle and gfs node lifecycle. A gfs node should have its own reference count where its child nodes should be accounted. PR: kern/151111 Reviewed by: kib MFC after: 13 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Sat Dec 1 18:06:05 2012 (r243761) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Sat Dec 1 18:12:55 2012 (r243762) @@ -665,8 +665,10 @@ gfs_file_inactive(vnode_t *vp) ge = NULL; found: +#ifdef TODO if (vp->v_flag & V_XATTRDIR) VI_LOCK(fp->gfs_parent); +#endif VI_LOCK(vp); /* * Really remove this vnode @@ -687,16 +689,17 @@ found: if (fp->gfs_parent) { if (dp) gfs_dir_unlock(dp); - VI_LOCK(fp->gfs_parent); - fp->gfs_parent->v_usecount--; - VI_UNLOCK(fp->gfs_parent); + VOP_UNLOCK(vp, 0); + VN_RELE(fp->gfs_parent); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); } else { ASSERT(vp->v_vfsp != NULL); VFS_RELE(vp->v_vfsp); } +#ifdef TODO if (vp->v_flag & V_XATTRDIR) VI_UNLOCK(fp->gfs_parent); - +#endif return (data); }