From owner-svn-src-head@freebsd.org Fri Mar 15 11:49:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E4C91546FC5; Fri, 15 Mar 2019 11:49:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA714943EA; Fri, 15 Mar 2019 11:49:46 +0000 (UTC) (envelope-from fsu@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A72A59A1A; Fri, 15 Mar 2019 11:49:46 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2FBnkak081700; Fri, 15 Mar 2019 11:49:46 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2FBnkV2081699; Fri, 15 Mar 2019 11:49:46 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201903151149.x2FBnkV2081699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Fri, 15 Mar 2019 11:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345179 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 345179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA714943EA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Fri, 15 Mar 2019 11:49:47 -0000 Author: fsu Date: Fri Mar 15 11:49:46 2019 New Revision: 345179 URL: https://svnweb.freebsd.org/changeset/base/345179 Log: Remove unneeded mount point unlock function calls. The ext2_nodealloccg() function unlocks the mount point in case of successful node allocation. The additional unlocks are not required and should be removed. PR: 236452 Reported by: pho MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Fri Mar 15 11:21:20 2019 (r345178) +++ head/sys/fs/ext2fs/ext2_alloc.c Fri Mar 15 11:49:46 2019 (r345179) @@ -412,23 +412,21 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred td = curthread; error = vfs_hash_get(ump->um_mountp, ino, LK_EXCLUSIVE, td, vpp, NULL, NULL); if (error || *vpp != NULL) { - EXT2_UNLOCK(ump); return (error); } ip = malloc(sizeof(struct inode), M_EXT2NODE, M_WAITOK | M_ZERO); if (ip == NULL) { - EXT2_UNLOCK(ump); return (ENOMEM); } /* Allocate a new vnode/inode. */ if ((error = getnewvnode("ext2fs", ump->um_mountp, &ext2_vnodeops, &vp)) != 0) { free(ip, M_EXT2NODE); - EXT2_UNLOCK(ump); return (error); } + lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); vp->v_data = ip; ip->i_vnode = vp; ip->i_e2fs = fs = ump->um_e2fs; @@ -438,11 +436,9 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred ip->i_next_alloc_block = 0; ip->i_next_alloc_goal = 0; - lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); error = insmntque(vp, ump->um_mountp); if (error) { free(ip, M_EXT2NODE); - EXT2_UNLOCK(ump); return (error); } @@ -450,7 +446,6 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred if (error || *vpp != NULL) { *vpp = NULL; free(ip, M_EXT2NODE); - EXT2_UNLOCK(ump); return (error); } @@ -458,7 +453,6 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred vput(vp); *vpp = NULL; free(ip, M_EXT2NODE); - EXT2_UNLOCK(ump); return (error); }