From nobody Tue Apr 18 01:35:46 2023 X-Original-To: dev-commits-src-main@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 4Q0mhg5ZZQz45Vfv; Tue, 18 Apr 2023 01:35: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 4Q0mhf4mLxz3K5V; Tue, 18 Apr 2023 01:35:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681781746; 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=OBZ54CcvpwvpXB13QMqhWt4laxjJm7ELRWQrGTRrwR4=; b=bWfguBw+gnHIRDnlybqRKYkyQ24Pi9o2GktrkGaYDfZ8D1QvD9bx6OoAyl3R27u+b6qJ6j +THxjpOGmuTBXxbPx+xkjGf4vA1VUsjnd2wIS3oQO64Zqy3B9yJU+PhEKtsE46NxikCFtN Ww+hoK0qRTKT3u1VS4avAqWvQMS/kwz7blbPRO+sdexro6Ilyn8JULZkP/jOSaT9U5E406 rqVP46Rltj8EhiO7Wl58gHNTGRGycKq+YG5Le75Gyn8BvHMKgqz7TNO9Oc8VsNRYHx8Cmw hsSY2+5RwYqtVfC3FyQxQoPZWtCgop/PK1P7Em/RaRQwb4yeOnlXpynaNlucfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681781746; 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=OBZ54CcvpwvpXB13QMqhWt4laxjJm7ELRWQrGTRrwR4=; b=tcQtUT+MIq7gQpjb06lk9/4MVK5mIM3H4suB7BBshR80R8/n8KP8i4l0yCzAiu2CnuHr1b mwYHB71Qd8nFNL7au81t7iuNUCOVae1s6rX8vsZQqkhNLlkZ3ALv3VPhB4lIRV0LI3Yugl 0+ogCzvK3blakl77TVcI5PgkiPrSKYOuYO8kSiNsURN2czp3O9nJ0y238ZaE+WJk+TCOCC 6n+gZjCHkN1cS0k4lHNG9CZaMGUXCqGrXxV2bB4Bhr0W0RloBm1kRKCjCYdR7r7qPqYrFF d02Pj7cwMroNyWTY4w44hthwzStHndxRP40lzxU+kuT0/2UUCHY5pknKaQ+gVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681781746; a=rsa-sha256; cv=none; b=jHNKLM7bZn0tgWBlB33r24ZDbTBTysOdHRYxZnloQa+X2K96+TnD4oAOHGjr2l4GF//Wef IVU4l0KNEo0D9l4jUhlCBwGUaYUqtRGpLg9zVedCZpZ4Wjd8eZSRE6B7r2U1Hs/HYorDln Tc9RBG35hMAdsiHbnlRZbJQZWoRaBWfnR4JnAKGSHn5iQsM5zc4LPDHxsVH1LadjmZzROm Ls1t2wtCSytYYbF28saiZa0ubwXEw1dpYf1nos5Oh7RFWQvLH2WT3bftolHREV2rhIHwSC wil2GdNM2aqlWKihjF5qna7qHnZzGhdy7BfppvpaerAKMQ4m4QP3GLSLcvargA== 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 4Q0mhf3rcBzsVd; Tue, 18 Apr 2023 01:35:46 +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 33I1ZkSQ042483; Tue, 18 Apr 2023 01:35:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33I1ZkJs042482; Tue, 18 Apr 2023 01:35:46 GMT (envelope-from git) Date: Tue, 18 Apr 2023 01:35:46 GMT Message-Id: <202304180135.33I1ZkJs042482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jason A. Harmening" Subject: git: 0c01203e4725 - main - vfs_lookup(): re-check v_mountedhere on lock upgrade List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c01203e472567017da3e525e409c83bd5418a75 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=0c01203e472567017da3e525e409c83bd5418a75 commit 0c01203e472567017da3e525e409c83bd5418a75 Author: Jason A. Harmening AuthorDate: 2023-03-28 18:06:29 +0000 Commit: Jason A. Harmening CommitDate: 2023-04-18 01:31:40 +0000 vfs_lookup(): re-check v_mountedhere on lock upgrade The VV_CROSSLOCK handling logic may need to upgrade the covered vnode lock depending upon the requirements of the filesystem into which vfs_lookup() is walking. This may involve transiently dropping the lock, which can allow the target mount to be unmounted. Tested by: pho Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D39272 --- sys/kern/vfs_lookup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 172aa4b4f576..d9a9cabde177 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -1280,6 +1280,9 @@ good: error = ENOENT; goto bad2; } + if (dp->v_mountedhere != mp) { + continue; + } } else crosslkflags &= ~LK_NODDLKTREAT; }