From nobody Mon Oct 17 18:13:31 2022 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 4MrlVN5HxLz4b6jv; Mon, 17 Oct 2022 18:13:32 +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 4MrlVN1dXkz3mPB; Mon, 17 Oct 2022 18:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666030412; 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=nsCTZxs3nr50dBAZTTtiDcAAA+cKcjBpy28J8D5NWus=; b=xLhI9nNUXbq2Y1wq7X36Q2EXkVBdM+PRrXA0wEYjQRPKxAlCL7yl9km86hxqtaS56NRlRU 8USnPZNKh6cxGF2v7+rKqVWwtKLK6RvZeRIQ8HeYfKTxEskZswxCGX2eTFgJ2My6ceh+OZ Oj8SwlLH6gu0kGyvgRQHVxYl8xDC1wSA/asqHvQfJn7maNTSV6KzRXZoKLKPZw81M+Ihfo ykmD8ctfcslbPQZE4h9UtykF13et9Leq4dzmxEUd/1J+Pgjgt1WQz/zzjeXyNIHggDBdwH lv+ntbK5x+0uDYQN4N063PBZEIY4Qj7Alsqqh0hLKD0mZcLXXFMRDZGuQnWlmA== 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 4MrlVM6YY4zvXX; Mon, 17 Oct 2022 18:13:31 +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 29HIDVFi008779; Mon, 17 Oct 2022 18:13:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29HIDVGi008778; Mon, 17 Oct 2022 18:13:31 GMT (envelope-from git) Date: Mon, 17 Oct 2022 18:13:31 GMT Message-Id: <202210171813.29HIDVGi008778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: ba4782022ac8 - main - ksched: correct return code for invalid priority 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba4782022ac840bd20f4e10cb95ca27d2742333a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666030412; 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=nsCTZxs3nr50dBAZTTtiDcAAA+cKcjBpy28J8D5NWus=; b=gj+0sc0NQTwQlymmtsd7oQD+2JjFJZrDfg+wYlfHwnkMobXQm/m2TJ5T/8oUMp6n891NfZ Lzv3OOYvvUQ0ToZ3B8N4OUsCYUNC7eoJhEAJ/zKSYnp219Vcu7Szfj41CoDr3mvQVdxDkY rWB4ECARfO5rOSB8bbROjRhwYkAiExNTxkmhSPWoi2wet53FsPfyyM8d0G0D/bWIP74bh6 8JA22wMfsmFnquv7wpF1kzdkOEZiQqhIU7DEYGgZ6cES1qnAo8AoAVPxfqUvEsxVgOMG43 d1K9AXnCCgO+PIl581iHFnmozLM3LlZcdvs8ojtKp/4JjS7Tc057EsiBV3CMGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666030412; a=rsa-sha256; cv=none; b=V9I7G2jx/cWD+ZlPqCtH57CsAEuZmcnDMn7zz7yOVZ95tkPqSX8FyKMCX/tq6Sr37gbjdj 1+z+EhRqfIy8FxkGrAd/WLFN78v6P2WMj0F5FlqFZbaNKuDTiYZYkmnrVvEETmHupHoH28 0eJQNGJ2Co0wWZXH/HqGk6/lzwT74q6ZSY/XxFb/vHvdWNF7aPhQ+1BAQLTvMbnrt2m2mE I2XVPOaNvWcAMiT0qMGwO8uNAUUz1/hRAcmbgaxzIn5sZNXMXHkUqhs0Op6VhYE6l0DvZp ujBY+a3DqMkrV2XwxjXTanRCIrb6TvPqLPCkyBbJegxcvU57W7fhikXlCnSpqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ba4782022ac840bd20f4e10cb95ca27d2742333a commit ba4782022ac840bd20f4e10cb95ca27d2742333a Author: Ali Abdallah AuthorDate: 2022-10-17 18:11:48 +0000 Commit: Mitchell Horne CommitDate: 2022-10-17 18:12:13 +0000 ksched: correct return code for invalid priority By convention, EINVAL is returned when validating arguments, not EPERM. This matches the documented behaviour of sched_setscheduler(3), and that of SCHED_OTHER. PR: 227735 MFC after: 1 week Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D37021 --- sys/kern/ksched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/ksched.c b/sys/kern/ksched.c index bf03a46315c2..1d5cfb26cacd 100644 --- a/sys/kern/ksched.c +++ b/sys/kern/ksched.c @@ -186,7 +186,7 @@ ksched_setscheduler(struct ksched *ksched, struct thread *td, int policy, RTP_PRIO_REALTIME; rtp_to_pri(&rtp, td); } else { - e = EPERM; + e = EINVAL; } break; case SCHED_OTHER: