From nobody Mon Jan 15 10:31:43 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 4TD7jW6yWLz56ZqP; Mon, 15 Jan 2024 10:31:43 +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 4TD7jW4QFLz46Cy; Mon, 15 Jan 2024 10:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705314703; 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=anj2RV0DvFku2n2DmGITFAUIszJ2vIMp5b9ZOAtvsE4=; b=gnFJ0djAd2JWTIdqMDA2AxSNweiLMloAg5zZLauOHIXH1IYDKYLB0SXVIFONaxmIhICfgB lx8mTFlXKoP+1x5RzrUtTLflmdF6eepJtPQcuAlWcC4QvdsbpmieB/S4nw1Dv5jCuucoqt Pt27thsyX5X394lkFBtF8vSBFGtcL7X4UUnPKffiLLS4b7BrGYNxqDjBn4eF2mdOKRKiCn 1QgPqFSZCd7xt20BMaCM7rgazkx+JLAD2SH5janAw96Ze1o1fK19k0lSJJKTgEO3wywASy 3qI4RLkGiAHknyzkPHt8mgYCfPqU2KybuqYzOS4cgnIsqO/2jne8EfSBGgIkww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705314703; 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=anj2RV0DvFku2n2DmGITFAUIszJ2vIMp5b9ZOAtvsE4=; b=uDjEJ6f72HsqQpS2Fqsk63670tsaiDlkAG3qg6oqaiCKNQNzz4tAznlhQLljT8eaRSDJCS drmRmhgqPlcz/xYSNDyZLb8w/koSWVUjfMm4hMJG7aJ56d56ECAuTR7BS7CtHhPfC3CHyJ fGEA6mFV+vY2DS44UNGxRodvZsB3I3fNIUsjCJHV//BfepcSK+NL0GjrRf6NGQvKJyxg3w 3llhMPiS9I7N34hwsk57mRPQT/J9ojV/xvLV8DKmOzQ+jJFIx7nRvKfK2QEceSsKKV1gE9 wN77+6AGMmnG4BTNGZWwD+AHSe7pg+CYlB1BxBnWE3JDNOHqiXMdN8AbV7OlZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705314703; a=rsa-sha256; cv=none; b=thHC0hLnqOFhF7Szk6J2kPLUtpMU8GDvSQIL4uE1JFyIRJvGDdua5eeYLnlATpuGu+8JNJ q0uR9MEwRc0cVq39+EwXoGay0uaanX3Tn7GAHjV0a5IoX7HC6NXkrzX66Z4FNDxqVA/1q7 ZSAISBnytlDBzIWN6m+ChlImEKwff3t8cZ8LUdobuw2r8rXPz0Wen4wvn6yssAR5VcVvj6 DltRdAEz5r94bDf/uToNW8kDOYP7JnrPUGlDpJlWn82HeX1t9XGwd38YNqXOa9mypm+wLm nnTQqvaHQKswFa17mwxX8BiwhY9lAcDlkhEWCqPoRj76cobFelRwUusdxKf5Iw== 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 4TD7jW3BbmztBx; Mon, 15 Jan 2024 10:31:43 +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 40FAVhQK018099; Mon, 15 Jan 2024 10:31:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FAVhmv018096; Mon, 15 Jan 2024 10:31:43 GMT (envelope-from git) Date: Mon, 15 Jan 2024 10:31:43 GMT Message-Id: <202401151031.40FAVhmv018096@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: 445eb90240ec - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 445eb90240ecbd095d8cf865af6773022e8dd750 Auto-Submitted: auto-generated The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=445eb90240ecbd095d8cf865af6773022e8dd750 commit 445eb90240ecbd095d8cf865af6773022e8dd750 Author: Zhenlei Huang AuthorDate: 2023-11-07 04:45:25 +0000 Commit: Zhenlei Huang CommitDate: 2024-01-15 10:31:01 +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) (cherry picked from commit d18326a7cf14804086550c7463be9721e8d28b64) --- 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 f0732e7012ae..c199d4eb0f31 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -448,8 +448,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) {