From nobody Mon Oct 24 15:54:16 2022 X-Original-To: dev-commits-src-branches@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 4Mx04T1pwxz4g2xR; Mon, 24 Oct 2022 15:54:17 +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 4Mx04S6Xwqz3XJB; Mon, 24 Oct 2022 15:54:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666626856; 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=YqfHFasu9maUzKps9DKkQTmLx38SYN2Fw9TTlLgb8D8=; b=GDNc/RTBmpSnavA8k5x2Xf+QYcsAesVzMxvCvKcGgqdX2J/jRf4/QC6FWFdk3rxTHAGX5t n/EBdijREEciC/+ZYLe2OHbD93qfq/c4Wt7Cq5xHP0E3GvaDmH9t2SOzzZ7GAR+A3qLw0b 7GoWHhtREaPzDbCbuPUkEi8rZEKHPD1Baea1HiSwrpP30fKymLx9/iT0wafqRUmBkytF3w FCav4fFJk0bjz7rKrJdWpuSJjQyKfSvExy/fvjMpule0+NIgO6geeQpjD9F7fiVq/cOBu8 bKbIg4SpMb0+s7GpBDeI3bLRXrcZsVgl3dCUDsmu+ObX22ObsggRJxr/oKWqZg== 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 4Mx04S5dNGzHKY; Mon, 24 Oct 2022 15:54:16 +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 29OFsGNV013598; Mon, 24 Oct 2022 15:54:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29OFsG5k013597; Mon, 24 Oct 2022 15:54:16 GMT (envelope-from git) Date: Mon, 24 Oct 2022 15:54:16 GMT Message-Id: <202210241554.29OFsG5k013597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 3097c0500581 - stable/13 - ksched: correct return code for invalid priority List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3097c0500581151732e5d7a20bdd4e3997cab2d5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666626856; 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=YqfHFasu9maUzKps9DKkQTmLx38SYN2Fw9TTlLgb8D8=; b=EvhlGTQP42b15iOz88HeT/Rkizr0B/TeF3KfRK1b1w9el1RyOqgR9s81/iu/2ii8Irje1F WmQ2Cl/K3pKcP6Hg+tgMlD7eNqY7wJ9xCUoGMXojKD/BxqRkLtfEK955/hIPW6KVc6882b woZWdmUPga0hb7LOA9S4Fb/NH67f/9vyPt4quLt4EKXHrIJSjO0/pnFoDW8o5Wchke+eKs wzqYBl17cMj89j/w6qO6efAEVlf0CA1b7dwRiTeW2qsjoBzrumUevFM6lRaYsBopLXr7iA HhuozrDlyb1CjCak/WuhllvXq1MWZo4QAbxJv3l0OufV4gVKuUaI6jGpx4OuGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666626856; a=rsa-sha256; cv=none; b=FU9uu9/uPbNE/cN0l/5E3Qkaf8TlMdi3RC4I3y0J12Q3hNRubea8JjdKVNNcpArh98XV6f RLWHjjQP1GdbZopysQcexPBZn/Cs6fUkyGcUL+3hDgmoo3MP3X7qVUuWJH2x6W0mIPhByz uznLa236kkCOfBjjT9mm9Y+i84NsZV1b+LZ813TcX4RyfAXojbd/oyL4ZQ95lMCz51IiZE aDgS10UWIp2JFHlfZJ3dxAWFltoA8UPCndidwwLv3lC70RimkjIEFUnB6rZWemCnCpoy7f RqT/0/rekpU4Jy2GliS9UrlizqSoMsv2Zw//pZQlil4I5Psh7si/6O1EQXTtWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=3097c0500581151732e5d7a20bdd4e3997cab2d5 commit 3097c0500581151732e5d7a20bdd4e3997cab2d5 Author: Ali Abdallah AuthorDate: 2022-10-17 18:11:48 +0000 Commit: Mitchell Horne CommitDate: 2022-10-24 15:53:11 +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 (cherry picked from commit ba4782022ac840bd20f4e10cb95ca27d2742333a) --- 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: