From nobody Sun May 07 23:52:02 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 4QF1Rk6ncfz49kBt; Sun, 7 May 2023 23:52:02 +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 4QF1Rk6M6lz3v4H; Sun, 7 May 2023 23:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683503522; 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=OdGfW0SWaRt6SOn0DLe1PKkn8IYET4pG8xst9zX0raM=; b=k0He7FoRjolE1c4RD7LSKo8bm3NXg28cM/L9Qrminnt2EYegtMDkR+ttI/b3on1GI4W/0B 7R/n4Qzne/fGtNL8v4fNIqNrenHccMeh049qbD2BZSHvvuo4OZHnd3ghBAN/6GoqHfEVRz JR1zSeyRtaZCPD59D+RHk0Jm0fmqYSe/JLzrMam7mvDOQGT5kP5r9vyg1HposzpqbhdjEq 640cBHLNiDyPLHdjFKzxFLfktQddcuA9BeHGzE5hZbyHNoYQNNAlpDs1xfKK0cQYVvO/7F W7Eyfm1XoUzd8RbfCQoZ5ITtmjDQozBytWds17a211Grog2O748MVn8AFEGR7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683503522; 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=OdGfW0SWaRt6SOn0DLe1PKkn8IYET4pG8xst9zX0raM=; b=TFpdwerTt9jkq+f2TNNi66GWCYydih260MCZPzugsHlr9b41VrKF63gc8+fxial0kUZcxR 03iHwjcVTBGnJowhD8QdI8DR8tfP8KaTS7kUdwVTannEgkKAkiXgtmdvucrttyJ79BiNS5 jgrL9vQO55VpH/VLKq5plt1VknmWnkmeCtverVXOTUvkAkIG3ovq5j28A2JbWPhhkCkXU4 oNf8bk/+hWGFjROgApBgtDYzknyhIhaHiAj/j3Z/GnFRYMLKDaXle/K46oZdjWJkuXZfhb IQ9DuOuDZMo9v3xcNbkT3YucvUqWWaqp23/MLQLYmBgu+cveSMTfMKXa1kXaTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683503522; a=rsa-sha256; cv=none; b=IWc0S2NsgaXbLvcXNa3ekmk+kvxGoSqjEIhwflEbWZU7dEIEMeCJnZgggiEkucKUaq0fKO X9kR+yi5dRIQpzNqP5cSH6W3OHhlgNom3ksbSKjX+twCMV35SC1fJ5sXI/ugUNaNdMf6VP VdXBRxCw2hv2oYX5wcGEyRAdYTHuX9rwypgTleymA9mfBnju7Rzsphem8/wAkiRAQ/Rt4I IqhD1Xr7RWm27VB6IOXbh2yx2U2TIIgn5pL3s6QdJbOJv4AhmXErHzlzWWxaJnyqhXztia IH7WUEWKzPau4yqslmQDUW7FEXE22U0nnPjpX1XKaL1sjUGyXUkLkgViTBxDsg== 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 4QF1Rk5Px4zddQ; Sun, 7 May 2023 23:52:02 +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 347Nq2gr002858; Sun, 7 May 2023 23:52:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 347Nq2Ft002844; Sun, 7 May 2023 23:52:02 GMT (envelope-from git) Date: Sun, 7 May 2023 23:52:02 GMT Message-Id: <202305072352.347Nq2Ft002844@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: 080917298512 - main - unionfs: fixes to unionfs_nodeget() error handling 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: 08091729851294fe302548af3c57c51aa12692fb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=08091729851294fe302548af3c57c51aa12692fb commit 08091729851294fe302548af3c57c51aa12692fb Author: Jason A. Harmening AuthorDate: 2023-03-26 01:30:25 +0000 Commit: Jason A. Harmening CommitDate: 2023-05-07 23:30:43 +0000 unionfs: fixes to unionfs_nodeget() error handling If either the lower or upper vnode is found to be doomed after locking it, the newly-created unionfs node won't be associated with it and its lock will be dropped. In that case, clear the uppervp and lowervp locals as necessary to avoid further use of the vnode in unionfs_nodeget(). If the upper vnode is doomed but the lower vnode remains valid, additionally reset the unionfs node's v_vnlock field to point to the lower vnode lock. Reviewed by: kib, markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D39767 --- sys/fs/unionfs/union_subr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 264d37634949..702b10bb6204 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -397,13 +397,15 @@ unionfs_nodeget(struct mount *mp, struct vnode *uppervp, } if (lowervp != NULL && VN_IS_DOOMED(lowervp)) { vput(lowervp); - unp->un_lowervp = NULL; + unp->un_lowervp = lowervp = NULL; } if (uppervp != NULL && VN_IS_DOOMED(uppervp)) { vput(uppervp); - unp->un_uppervp = NULL; + unp->un_uppervp = uppervp = NULL; + if (lowervp != NULLVP) + vp->v_vnlock = lowervp->v_vnlock; } - if (unp->un_lowervp == NULL && unp->un_uppervp == NULL) { + if (lowervp == NULL && uppervp == NULL) { unionfs_nodeget_cleanup(vp, unp); return (ENOENT); }