From nobody Tue Apr 19 21:03:47 2022 X-Original-To: dev-commits-src-branches@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 B43D311DC728; Tue, 19 Apr 2022 21:03:47 +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 4KjbrM4Xv3z4tHN; Tue, 19 Apr 2022 21:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650402227; 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=SDoqK9Gjzvybmnoch2tk8KCgqnZgYVkcThfXTyphFx8=; b=PLYyUBXltXTbIxN6+3wJoocOJoj6chrI120opRtpvoVVKFMnGx0LkcPPfPmL8OioZy7xil mtLsGihTrOkQgF2GCncb5ZaeSroyiUaaC+edVIfbOPmQ24pUVB/ZE4UujNCVvTHvI1CRz8 YiRv0oM3c1XnyPBDHdGF6IJ7FCctmnan86koehzT7OFTpkh9oDAZzvgPnkrvLWI0V7MMuQ V9EiOV9CTMA913NXkkGXw3fZ0uZfdHn0Q/g+I0g2F4N5j2iFlSb9tmY1F8tNGgux1Xg0GA dlZDB25+I/Msnmlq2c+P4/QzAIAbRdS7zjtFzdnNJy7VYhFgZrSz91oW55ZCgA== 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 7BB222E5F8; Tue, 19 Apr 2022 21:03:47 +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 23JL3lMb010332; Tue, 19 Apr 2022 21:03:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23JL3lWb010331; Tue, 19 Apr 2022 21:03:47 GMT (envelope-from git) Date: Tue, 19 Apr 2022 21:03:47 GMT Message-Id: <202204192103.23JL3lWb010331@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: 821467b5a087 - releng/13.1 - Mostly revert a5970a529c2d95271: Make files opened with O_PATH to not block non-forced unmount List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.1 X-Git-Reftype: branch X-Git-Commit: 821467b5a087bbe5ee7eac5345dbddaf7c799e7c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650402227; 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=SDoqK9Gjzvybmnoch2tk8KCgqnZgYVkcThfXTyphFx8=; b=eEQgPklOjodaoQ0m6thnNbMjD//Na64USkuMijgj0rBV8Iv3rLl1bdUVm6GZ3l9TMvjnOZ cKEWkNUT/1q3N3DJcJzRHluSi7l9Gsn6W6zoIWtdY1G1mm57Lg0THYevafykBUgb+KnAn0 ZFbWeYTGLjt1mmWfqsC2KywR9yIAE7qX1z9r1eOJ3SoRiUriGeM8Ckjyub66jzhm91LYVM HBcDTpBa5zi+/Csl3LyWDdlkAScvfAsfeaCH3b7i45Z9xztCfsVPdRSXiXbb0iSSDn3Hzz 7XxbQNEp+P3adySWtn+HCSVjCyMQ5DXlwTWsLa0RUu7POniluAkyySg4jcbdEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650402227; a=rsa-sha256; cv=none; b=bJcxHb8Gyf6lPrAIkDElkw8kJGD7KIQ53RTKOrULDhURur1jnGYtPvilXE3PEwd0McEy25 IoOHatcqhxdGgXEBIjxvVNLUXOAg+/xrI/HaIr/tUOc/4awOBzuUaH6omfNOlXS+htqLg5 q63I5h75o1J1gBv52Gg3Htbx21w2OrWvHAViSdPz84p1gWemjzG8eGXIZh6YDmJMxM3m8q 5TLLZS9jmLdxJyO8zqLVivaWOOqAkMc4XiM0zW1iFgbhLiePNi0yY3uQX8ao7hG5koYbQ7 ddUYm5niAF58myMQ0DCxLHdYDh3IIV89Td5c/swyGOxwbB/vCEi9Vq7+fdTr3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=821467b5a087bbe5ee7eac5345dbddaf7c799e7c commit 821467b5a087bbe5ee7eac5345dbddaf7c799e7c Author: Konstantin Belousov AuthorDate: 2022-04-13 00:47:45 +0000 Commit: Konstantin Belousov CommitDate: 2022-04-19 21:03:16 +0000 Mostly revert a5970a529c2d95271: Make files opened with O_PATH to not block non-forced unmount Approved by: re (gjb) (cherry picked from commit bf13db086b84c29ce901145f2800c561dcbf4d1e) (cherry picked from commit 6daddc54debbf590cae17bead4864c7f640c07d0) --- lib/libc/sys/open.2 | 5 +---- sys/kern/kern_descrip.c | 2 +- sys/kern/vfs_syscalls.c | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index f6b061079ddf..876a4ce1e57d 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd October 9, 2021 +.Dd April 22, 2022 .Dt OPEN 2 .Os .Sh NAME @@ -351,9 +351,6 @@ But operations like and any other that operate on file and not on file descriptor (except .Xr fstat 2 ), are not allowed. -File opened with the -.Dv O_PATH -flag does not prevent non-forced unmount of the volume it belongs to. .Pp A file descriptor created with the .Dv O_PATH diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 8764e1562c56..d584c54403b3 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -5200,7 +5200,7 @@ path_close(struct file *fp, struct thread *td) { MPASS(fp->f_type == DTYPE_VNODE); fp->f_ops = &badfileops; - vdrop(fp->f_vnode); + vrele(fp->f_vnode); return (0); } diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 32868eb7a4d5..d90dd72c8ead 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1208,8 +1208,6 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, if ((flags & O_PATH) != 0) { finit(fp, (flags & FMASK) | (fp->f_flag & FKQALLOWED), DTYPE_VNODE, NULL, &path_fileops); - vhold(vp); - vunref(vp); } else { finit_vnode(fp, flags, NULL, &vnops); }