From nobody Sun Jul 23 13:44:20 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 4R84K11Yggz4nXRF; Sun, 23 Jul 2023 13:44:21 +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 4R84K1165Zz3kDH; Sun, 23 Jul 2023 13:44:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690119861; 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=dgVVJvY/VzzRvK5AVgeiQdaLV8YodB8TzVJv8N7fLQI=; b=yh7oE2A/nxxtZVvQv7mvXJwDRZxA7Booddk46rbdYUC5D4AngQ4fYaqWrlficXkvzMB9Hb pMGP97Z+elFoR6jUWe/ATIcGLUamq7HqHQDeFjyBSULVLaiNL9YwxieN+FEtVLxI58LAaw a49m7ZTLPYDWTsjSsdrZpm04NIQlHtjmeAc+XcV87/WrVdpop3UGF+LuDNhKSOIw4361Tl AQnrmdwJfXG/pQfX1krZL9eYnv6v2F8veP+Pu+utXTS9QvPyCOS48maltTUoJFdEaIjwWw JZM6h383yW3RPp8rpFklHmB7y9bA9hzk+bqi2R16ciDr54Cbxgx6+2UD9hOPpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690119861; 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=dgVVJvY/VzzRvK5AVgeiQdaLV8YodB8TzVJv8N7fLQI=; b=GwAQ1gqGXha5fVk16qhanuIZnAqGKHSZZWZFVPqQezsc9WT+q+XlLMGPzRd3y2ymlnq1Uc 4ZF+NiR1RPX7wZ/B9lwVWwda1D6sMu3/CuLk+mlyxIRMkZc5oLUXRm2A1GgWe1eEbkymZi xXaZQtErQks1ycu8sGXSAhGO9ML1JVYplcJ6EqPg/5NLyD+bU5Jk8urj39hU2hWBEoyvQs 1grBB9fWnVCFnk9aOoqbgpwU35xVDEJfLpgqN0TWJdKWzX32hPH6K+AY0RHM3cmgjYSirc EJ67G4dpltQLi6Gxp3wT9BzaLdkC/GPiaazfOm+EWouF8oL/UkONMv1w/++vDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690119861; a=rsa-sha256; cv=none; b=ylWW02zm5H+MF1tLqYgwNJ5dy50QALgzn2MfZAzozoe8zBBBIlg9WeAA2GF2/qhWYJop1C UT7Ws0cs+yiwRYETWoLLUOhoempUTNyF7Cfas3I8S5YEL2ZAMFhJ3tExswKLr+QgXqchKv vDWp89PRNYRAM+4zLrunwby6kivzLl9aIE+LOI/rRvL7EEozv3xlmmDSQJkqgFDmjJkRgm Nt9pqfyvYfzL6DnGfyvOcTxQe7HdibYvidV6APSFfmcmIOHOnTXw6jdqDK5sOG3M228uN9 7Ac0uLTxjbtjL7sT2IWkf7If2RpdV2VsA6qpIGtQj3v2sVrrUOZJOvtukROb+g== 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 4R84K10C84zfLm; Sun, 23 Jul 2023 13:44:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36NDiKiV093891; Sun, 23 Jul 2023 13:44:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36NDiKtO093890; Sun, 23 Jul 2023 13:44:20 GMT (envelope-from git) Date: Sun, 23 Jul 2023 13:44:20 GMT Message-Id: <202307231344.36NDiKtO093890@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 176d83eafc5d - main - vfs: fix up NDFREE_PNBUF usage in vfs_mountroot_shuffle 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: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 176d83eafc5dbeef194ed0e7b1cb24b0ba373fae Auto-Submitted: auto-generated The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=176d83eafc5dbeef194ed0e7b1cb24b0ba373fae commit 176d83eafc5dbeef194ed0e7b1cb24b0ba373fae Author: Mateusz Guzik AuthorDate: 2023-07-23 13:42:34 +0000 Commit: Mateusz Guzik CommitDate: 2023-07-23 13:44:15 +0000 vfs: fix up NDFREE_PNBUF usage in vfs_mountroot_shuffle Noted by: karels --- sys/kern/vfs_mountroot.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c index 956d29e3f084..b08b2a3200f8 100644 --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -352,13 +352,13 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs) NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspath); error = namei(&nd); if (error) { - NDFREE_PNBUF(&nd); fspath = "/mnt"; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspath); error = namei(&nd); } if (!error) { + NDFREE_PNBUF(&nd); vp = nd.ni_vp; error = (vp->v_type == VDIR) ? 0 : ENOTDIR; if (!error) @@ -376,7 +376,6 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs) } else vput(vp); } - NDFREE_PNBUF(&nd); if (error) printf("mountroot: unable to remount previous root " @@ -387,6 +386,7 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs) NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, "/dev"); error = namei(&nd); if (!error) { + NDFREE_PNBUF(&nd); vp = nd.ni_vp; error = (vp->v_type == VDIR) ? 0 : ENOTDIR; if (!error) @@ -413,7 +413,6 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs) if (error) printf("mountroot: unable to remount devfs under /dev " "(error %d)\n", error); - NDFREE_PNBUF(&nd); if (mporoot == mpdevfs) { vfs_unbusy(mpdevfs);