From nobody Mon May 01 06:46:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8tyq1gfvz47tqp; Mon, 1 May 2023 06:46:11 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8tyq182Vz3vp2; Mon, 1 May 2023 06:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682923571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LlHJ92wtrIgbNk8Vw5pNuSe2iJZ83+3x+gyaMm1WezM=; b=DZi3GHULsPjezON1JAKhqRfnv3q3bZ5qk8cljSfibPhl7pKBPdhIijPtQn343qyGDclUOe i/vx06VrEHBoF9F3WDDeJ4+TOZ4LtXpfFwnpLLdJC7Z59FKIo8kKzPO7amzx2k8WarJwHm iidHeY7z5g3/j+t6mEO4rzXe85FM1HA5eynSrr1kewaxWGhyrLLK5brpWNSaNi7/WGxhQl 0V69wAGsVh2Z8n8EPxfXFr5BnVu/Q9HGaeKsK8j+jhn1d4VBtdpbszaHnstC3qsyQQ81I+ XXj8FHk0yxQatqfsJv/5pm7Vimxduq5TGP4AOhLPnVluyBzdu9MdZbBwyVyOnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682923571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LlHJ92wtrIgbNk8Vw5pNuSe2iJZ83+3x+gyaMm1WezM=; b=tttcXZzEcAMLM+JsSDvTrVzQkSMmobQ+b8u8ww3uCDNiZ5+7bD5BgnWRCG7xkG0WcUbRTJ ZiFAmBQMtHpMN3wE2W8mtdAoqBksz6X+ouTupNTKSax+9Gllm8PyRzqzXQxv3Fo0kARAWF sYi/DBN/qPZ80/irIQGhuYNEBOc4xWABU6UgBPm4EVMmmFzj8bVXuSRaABi0c/z5nmccxK JvnTKGzLJ+b7flzF/qEaldWON09gzBrN/QCYHzUnR7B0XsmRVZM0gf74IXF97Jj3VtVTdn HT+DrXVN/FNu98/aY7B2u1npgVILG8l0/rLAWSHgP+6yj+bEMFBxw94s0slajg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682923571; a=rsa-sha256; cv=none; b=DMZOe7wzhpKIS5eIqauBxVwHRBXa655foAr8kANcf2nUk/VXNkwG5zUrO70ETLn6qoER9j AiETZLOy2YbSsECj0UQogo5quMjaxyGkYYs2ga1tx9WaM4ZRhzfRROm8/U+j8e92jVb87I Yfc3tuO9P0oOrTQoHCTv72a6A+fiRxrqj2qwC5GmK2xtMQQOn9f+fcWzRyXaAm9h2d6eD9 M/h1X7eSPpCfHeQ8tU3y7+hD1AFJjUDjReZls4ROh3orOPIi0cxz6RfQRw1FAmsbrLjdd7 S2ekYS7Oe2q0gJgLvu0Zouanr89aLBskZPd1n0WGE/KDfH0c290IXwDgBEvWgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8tyq01mmzvqs; Mon, 1 May 2023 06:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3416kAT1030240; Mon, 1 May 2023 06:46:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3416kAY2030239; Mon, 1 May 2023 06:46:10 GMT (envelope-from git) Date: Mon, 1 May 2023 06:46:10 GMT Message-Id: <202305010646.3416kAY2030239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 3f5894cec67c - stable/13 - vn_open_vnode(): fix locking around VOP_CLOSE() on advisory lock error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3f5894cec67cd437bce5b8941ebfb4095d98e01c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3f5894cec67cd437bce5b8941ebfb4095d98e01c commit 3f5894cec67cd437bce5b8941ebfb4095d98e01c Author: Olivier Certner AuthorDate: 2023-04-24 09:36:09 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-01 06:45:29 +0000 vn_open_vnode(): fix locking around VOP_CLOSE() on advisory lock error (cherry picked from commit 6a5e61401502288ec10629beb28be048c1cce34a) --- sys/kern/vfs_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 566b781098ad..215c9d1cc0cc 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -478,8 +478,8 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, * If there is no fp, due to kernel-mode open, * we can call VOP_CLOSE() now. */ - if (vp->v_type != VFIFO && (fmode & FWRITE) != 0 && - !MNT_EXTENDED_SHARED(vp->v_mount) && + if ((vp->v_type == VFIFO || (fmode & FWRITE) != 0 || + !MNT_EXTENDED_SHARED(vp->v_mount)) && VOP_ISLOCKED(vp) != LK_EXCLUSIVE) vn_lock(vp, LK_UPGRADE | LK_RETRY); (void)VOP_CLOSE(vp, fmode & (FREAD | FWRITE | FEXEC),