From nobody Tue Sep 13 23:18:57 2022 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 4MRztT4Ww0z4ckFv; Tue, 13 Sep 2022 23:18:57 +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 4MRztT3xXlz3nkT; Tue, 13 Sep 2022 23:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663111137; 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=9OjsMAJj+ZQ7ul+WDu0daLKoohrzbCHku2iEjah3wZo=; b=f/cN1rvssBTm5dwO5aHkiEwbqAnlbprzn/Rs2K3fLP/nKZ9dXMwskr+7pKjEw4Dm7M3uV7 TR7XBqXeNickTu9+tD9iJk36bev+WdxgABiLS8/itVdrDJlYp2yXLIrSzHhgTx5+S1L1ZY Cjn+ZNsBf+ZNzLfODK1kYcDKaxvfJuoqDABw0nqkdxBhsqOXioDiwOppQ5NJKI20p3Sk42 qUFwqOcypis5z7Jj+IGSnmQFNamb0A+fEtsQRNVR+uffKEfFBdSQ85ybzwXcdf8bsNgf1d /rWjhRF6IMWVFx5+jXDsURVe9NPVaFb0lr5luNnyIMC+RwmQrwFUnb4gGoF99A== 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 4MRztT2tfRzTSb; Tue, 13 Sep 2022 23:18:57 +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 28DNIvA5071531; Tue, 13 Sep 2022 23:18:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28DNIv8D071530; Tue, 13 Sep 2022 23:18:57 GMT (envelope-from git) Date: Tue, 13 Sep 2022 23:18:57 GMT Message-Id: <202209132318.28DNIv8D071530@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: f7dc4a71da2c - main - vfs: plug spurious error checks in namei 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: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7dc4a71da2c36ae133c640ab5f4268443f49f97 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663111137; 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=9OjsMAJj+ZQ7ul+WDu0daLKoohrzbCHku2iEjah3wZo=; b=Rnskb9xj88umpTtSNMwNFBSxhoWoRb7SWhHyhMUOYYvIShGN2cgMCQh1/w71urbTBtfVBg MIU62lgjDjPZaTMiWw14HNSsPPx4GmDwWAqaV06KQXswY2Nu65Y9wqmZ9d4odB8qV4pnVa kuzwDyPuGug97tBbB6FEO0H/+FWkF6Ksc0N6jbcSqjtlUi15N07qsT0QEP9IADPTYjwV8i eZf8ksWZUTGFSOrhyoYQLalDoUIJ+fnXSwG3BYf+SQIWR3atd30JUEcyVYwIk+hqPUpKtD 1kITrqEbMuhQK7sBdIiMQruvoJQp9E4ImLMLbZ3UOikxN1QpUKUlYH0iCYtSQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663111137; a=rsa-sha256; cv=none; b=g2C1KCgMTNlT0t1QGKYSCaLoVYqWO0buMluf4jI85pKEjPStcSc/eOsrVyZgowgSSh5DhS 55JVNd5hl6vjYUiDYptN0Wcv1U5fUhul7z6Nkn26Qu515yDWv0kdH+pHdiNOT1m/Jd0MqL ljU1yAnK1cqe3M/NJV2pyGsfzVK38QAvIh5qbvhcT0LvkcsLTNJjMzyB2OE1qQmMwySmSy lWPtwvGOmXZokKMGEdzz1auOeBY2vOhsFakxEoohgrwxDFhBIDJQgdiW3BTB2I7C6SQObz xJhtHSuibqB6oj9Vvi8SPVq1T0s7/yGTVkfS9vmSNqFnm8xDgLqeAHD0MOLIdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f7dc4a71da2c36ae133c640ab5f4268443f49f97 commit f7dc4a71da2c36ae133c640ab5f4268443f49f97 Author: Mateusz Guzik AuthorDate: 2022-09-13 23:18:30 +0000 Commit: Mateusz Guzik CommitDate: 2022-09-13 23:18:30 +0000 vfs: plug spurious error checks in namei error is guaranteed 0 at that point --- sys/kern/vfs_lookup.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 20fb63dcee94..4281cd434fcf 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -689,16 +689,15 @@ namei(struct nameidata *ndp) */ if ((cnp->cn_flags & ISSYMLINK) == 0) { SDT_PROBE4(vfs, namei, lookup, return, error, - (error == 0 ? ndp->ni_vp : NULL), false, ndp); + ndp->ni_vp, false, ndp); if ((cnp->cn_flags & (SAVENAME | SAVESTART)) == 0) { namei_cleanup_cnp(cnp); } else cnp->cn_flags |= HASBUF; nameicap_cleanup(ndp); pwd_drop(pwd); - if (error == 0) - NDVALIDATE(ndp); - return (error); + NDVALIDATE(ndp); + return (0); } error = namei_follow_link(ndp); if (error != 0)