From nobody Mon Jan 15 10:30:29 2024 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 4TD7h629H7z56ZXv; Mon, 15 Jan 2024 10:30:30 +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 4TD7h61N7Fz45gn; Mon, 15 Jan 2024 10:30:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705314630; 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=76cHIcr/ZWx8aWeyNA8zAGc9qPBbKjlippArpbnm4QY=; b=j+WXbv2L/gAwxggD5YvTrh2uYAt4CI0DaD5OrsANSIrrWM2QFAX+TsCzBh+IrZSRodp3+K KfmJH7FI605kKodEu/vIvgFb/OcziUVFyVklmTFAbYPxXpl5Kywqz4yPm2LHk71fXNF8Y/ JXVu6SOZHyA6cN3+Q096St0XnTsssrTGbL7eggfEzhIT0IRobDHnV4lK+S3x/9oHVU3r6L d6H1LhUQaaIQGOvVISeMJO168aFfELCIC3KGCBJbP9yxFOMh+ZxmB6f8uMHRhlL6htCcis 2HcvC1C0S8ToQG/BN/slL5UoXXrtx/lRBJFLeBOc1JH0pxupq0bXHfqVO+vQNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705314630; 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=76cHIcr/ZWx8aWeyNA8zAGc9qPBbKjlippArpbnm4QY=; b=Otabv6xpHu1jxk9m7a8o3xzP27ptjJIuf9atgqO+8btZ92Rl/VKd3arA7PG8tR8C+GNW1K 4YuzyDcaJ7A639jtg5qoY/TJ6KaNo21N7KRH+EIVQwTnYK7po8bpIIzERz9vPiUT39m6yy fM6qsqeqVpGvxoxW+20QvF4gFq/GpzY1EFZF2uvnE1LRicZXbt+sqjgT8z8FPCiBXZsAyQ OAms2hCiQ9okBosW4mgzs08SvSPLxRwgdGKXuZX0EmvF24B2BQ9NNlH0Czj0sNAHg3W5yN /H2l+0scxg8vGimsq+BYLdFdHBAHNxh6FM6M6BdA7K5/kZ1odlGqnbaMEPzZcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705314630; a=rsa-sha256; cv=none; b=ftoIDZ3/S3CYUJ18s9UvmRHyu3wJIUsRcZuQBA12PJsih4enjU22GxHAlxzrG79DPsIN2o /lGOqDG2lR8MNSTmPaRaabhiJ4xvhCMiWDd2VkMDcWh9QSuHyG0EuJDfcwJJBMDfvTu2Ku RLf4rUfM7xTzfjG2atC+bKj2gsI8a4td9ilUvnCmZtSacAbCEztJ/3Nqf+73r/bMz5Tcpl WNvHb7Yppzk8RTz982vb97wMAwdytWFc7IOBiTo4Ejz5vrt9eZLojyKry6ByTJM5lFlbrU 7/JSYcellQIYHLTU2YO7ZkYOFplTh1Dkbn5ShsDTcKdQ+HSvg2ZBLFJ+0Rqcwg== 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 4TD7h60QZLzt8l; Mon, 15 Jan 2024 10:30:30 +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 40FAUT9E012837; Mon, 15 Jan 2024 10:30:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FAUTaG012834; Mon, 15 Jan 2024 10:30:29 GMT (envelope-from git) Date: Mon, 15 Jan 2024 10:30:29 GMT Message-Id: <202401151030.40FAUTaG012834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: d18326a7cf14 - stable/13 - kern linker: Do not retry loading modules on EEXIST 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d18326a7cf14804086550c7463be9721e8d28b64 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d18326a7cf14804086550c7463be9721e8d28b64 commit d18326a7cf14804086550c7463be9721e8d28b64 Author: Zhenlei Huang AuthorDate: 2023-11-07 04:45:25 +0000 Commit: Zhenlei Huang CommitDate: 2024-01-15 10:30:02 +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 (cherry picked from commit ecf710f0e04e3314a492747124166ccb7cf4019e) (cherry picked from commit e7fd435d3d4e888d9894d8c212c29ae6e2768f74) --- 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 cbf006394aba..87354e47d002 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -446,8 +446,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) {