From nobody Mon Jan 15 10:29:02 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 4TD7fQ451Zz56Zfl; Mon, 15 Jan 2024 10:29:02 +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 4TD7fQ3DcYz44qQ; Mon, 15 Jan 2024 10:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705314542; 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=Rx9EGfShTDwmKDwzRtj9L+s1IlmDlk3bfykKYWlBhpE=; b=WTjXAyvIYVBV9qjdUvqZPqJtS8A3U0JBjaNY8rNOT+l8sLp4llWRyzS0RqYPIYX5KOtQZK oXEVe3p3b8sXVpwdVq2fD26GAa0d9w7FYSXgXKR7XJ31OUahV7Kib2TPSBBVBYMALNPBsu 90C+xXnRP7LEqc1I1I/dEMNSUog+HH7WadfSsfL5rQ254QVkl2aIrts4gAL2CtRLhYn8b2 /JkXAdd1gv/ANwy2Qb97cpm7gP8KWfX8M6482CmP3ZKu7dsmr+QaigcIA/QDiZFId12PmQ XyOecHsScUxa0HY/P3mnCmwBqW0fLbFMl3xyhqxhOz3Ul7oVDA9OEHPaOyEDHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705314542; 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=Rx9EGfShTDwmKDwzRtj9L+s1IlmDlk3bfykKYWlBhpE=; b=emgeSsjYvxiyGqMzW9MLKMbj25a6pb613d/EzMOICG5mIHaCi15O7tTBe8+ZY3eSNV5uBH bFHTZcOL1L7RtgMLOWmnG8LU3ZMl7Y+KMMosaMfZCt+dG0Wh0qan2oAWNvjBAbXZD/0cXn SvBVy5JxeHkiUlTSi6zESwfWiMdgmD4cQrRrXtxCuV8QILhkkw3Z1rYg2nhfBoAn1eOZNd a9DSVOq7daMaQxQiQZLRgQL3DuinJon8MUsVUKsDC+/L6svyFOpRG2UJkYPesTub14kFOM 2HAFfh4qgmv4LnoQeSdU0VaBU7ZAZzlKRZZawnaWhkhh1d1hdh5JaBL7njm7jA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705314542; a=rsa-sha256; cv=none; b=H8wLAPrLKCZYB4AzathnEorCycQOXl7lNknni//JpDu+4gXBeZTEAFumBFirPvK9TQbGbY Twmiu+jNtZ+Diixvte0F4ao+DnAWpfZsdl3ApLGcaJ/ZX73cAhrp89Re1b4jI4693+RAMk F77g2pIxLG0GXvtnswPbf4Hw54j2/iH/1z7ITM3zZcvpJCyJKPruyzLI+L0jFzhIDK588C whWZ2smRCYnd3hvh4DilHx30FlGAJtMknFOf49oaZhseeU3DB8A0O3SDj4Q7+n7tQYp9po VoYhew1td1vHqg8KGtH2EVz62IGUAO122rh20XXwvsgg4cSq7CaQctT/xr4zCA== 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 4TD7fQ2Hbgzsjv; Mon, 15 Jan 2024 10:29:02 +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 40FAT2nm003806; Mon, 15 Jan 2024 10:29:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FAT2iF003803; Mon, 15 Jan 2024 10:29:02 GMT (envelope-from git) Date: Mon, 15 Jan 2024 10:29:02 GMT Message-Id: <202401151029.40FAT2iF003803@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: e7fd435d3d4e - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: e7fd435d3d4e888d9894d8c212c29ae6e2768f74 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e7fd435d3d4e888d9894d8c212c29ae6e2768f74 commit e7fd435d3d4e888d9894d8c212c29ae6e2768f74 Author: Zhenlei Huang AuthorDate: 2023-11-07 04:45:25 +0000 Commit: Zhenlei Huang CommitDate: 2024-01-15 10:28: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 (cherry picked from commit ecf710f0e04e3314a492747124166ccb7cf4019e) --- 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 a1073512e856..6ac2e694a4cf 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) {