From nobody Tue Nov 07 04:48:35 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 4SPbMS19Jmz50Xst; Tue, 7 Nov 2023 04:48:36 +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 4SPbMR6Scsz4HKC; Tue, 7 Nov 2023 04:48:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699332515; 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=REKMIY4VnCr8+byL9hcIPRRYs7/zl4kh0RQxC0n1Q1Q=; b=qfhN1Os/hECm2tBaGymyOdm5S3M2VZpvTYo8BHQKzxMI8ZmadOe5tVlo0uXwx2NyzAvX9i 96q0U947bIMprx9+u9klqj0PaYIQtwd2M7NbZQMVLYRwrxK7Ai0mR0voKm2EF+fXEjWoTh lxxyNtLTLfW4veDGqfRor8M/rv2UAzM6l/TYbqMbiiGvy+4NFKSz0jFICXAkngmJMp2tOA AI6pb7TmscyhKPXDGBnJAGxT+SeFYO2EgTBcqK5VLfrcKdDDN/Y74e9Pp9SKJnTi5cjmS8 hu/wNCWhLm7p3m+uMcTGdmndGzkMesHKe2YLq6AMXk5RfMb3xOCxxIt8gpmq1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699332515; 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=REKMIY4VnCr8+byL9hcIPRRYs7/zl4kh0RQxC0n1Q1Q=; b=Yym0RdYT1uRnhZgLkSO8tYY47OYZzUx6sp1HtcNQodRzKrWuu4tesv6PbW0IzZ+QeA41sS +DcGeGxFxwvWNckHNxurXD6FBZSNajVjRbuLP1iu3bAJ9IGP7N39pTAF8CdNyKGSemtQPE 18TuLn6/46jMuMFQJLVunGfKWggEJxNtIKgWolSudJxQZRrcZkICxO7duQTrceIKAjxSMP ZmS2Zcwt6QoSxxmkztFZOjNkcDGjRqREnoHCrfTF3LDHJ9QTUv6jhLGpEngfr3onxJ8NNl zXYOUwSKiRFPWFZWr0AS1LZ1I1xQ3Jv12D02dqetIil/NpX8KCYsbMRATZQqNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699332515; a=rsa-sha256; cv=none; b=deEoDnx+7VW1VhFNwFKhmblCAVYG3efuq2ovLoof5jBQBhpotNgKIBOZBI3GkxsQJeUfl7 +0/Db7qvfsCCUXoG9GIsP09UBWN9Pb1wOY+G6PPed2Tu2j3dht2egMv3cby6/5ts0rOk39 +YLNMvlkBU3vbkDjlEqt9RM4b5KuAHu0rY87+aRDDZDDRJbmw38SWeBXt/66VfmDVDrDoh BSi5jMLCIXK/3zcfMKfM2F2nfMVEz2v6zEGCM3BmF6NllMVTo1r5r0AOinNQXJT3QIhU4m LuQRj3KKBVkhCyW5VsXG6YTA1W2EadSDpY5JJ26IGI1xttmgVd8Q1T9dfVWjIw== 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 4SPbMR5YT2zbpS; Tue, 7 Nov 2023 04:48:35 +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 3A74mZ7J069243; Tue, 7 Nov 2023 04:48:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A74mZSm069240; Tue, 7 Nov 2023 04:48:35 GMT (envelope-from git) Date: Tue, 7 Nov 2023 04:48:35 GMT Message-Id: <202311070448.3A74mZSm069240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: ecf710f0e04e - main - kern linker: Do not retry loading modules on EEXIST 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecf710f0e04e3314a492747124166ccb7cf4019e Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ecf710f0e04e3314a492747124166ccb7cf4019e commit ecf710f0e04e3314a492747124166ccb7cf4019e Author: Zhenlei Huang AuthorDate: 2023-11-07 04:45:25 +0000 Commit: Zhenlei Huang CommitDate: 2023-11-07 04:45:25 +0000 kern linker: Do not retry loading modules on EEXIST LINKER_LOAD_FILE() calls linker_load_dependencies() which will return EEXIST in case the module to be loaded has already been compiled into the kernel. Since the format of the module is now recognized then there is no need to retry loading with a different linker, otherwise the userland will get misleading error number ENOEXEC. PR: 274936 Reviewed by: dfr MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42474 --- sys/kern/kern_linker.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 2367bf35da76..c6eb0273c39d 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -461,8 +461,11 @@ linker_load_file(const char *filename, linker_file_t *result) * If we got something other than ENOENT, then it exists but * we cannot load it for some other reason. */ - if (error != ENOENT) + if (error != ENOENT) { foundfile = 1; + if (error == EEXIST) + break; + } if (lf) { error = linker_file_register_modules(lf); if (error == EEXIST) {