From nobody Fri Jun 17 19:41:36 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 6763E85DEA3; Fri, 17 Jun 2022 19:41:37 +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 4LPqDJ5smsz3jNH; Fri, 17 Jun 2022 19:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494897; 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=/94FhElwbXG/VEl6MwvMd7/Mu+TydwgCeDU6xG9ESB0=; b=R1LsbbFF4PdVWGyhTla4SRdiulfEszJ+Y/2NVF2xstHWdtf+HXJ/+HY3zDF61Y4X9o/6EV WvobE4BwYext+5Qh0BlGM/8wPfZ/yWI+HLiOImO2mf2C0oho10lWrOkePXil1qOD+IEB6Q bZzD5EzpFwg1na87Qq76NqIVb4UwStTrJl5dH4R5E7FdS9HAMpgIyHEAQ06pMQDIsdnC5c g7a3v3+AccUpBOQ7vI5mV1edCZ9xe8NRvuy3ZFRuSTFGeq3D09wQmIPeMt52Ywt0Q3C027 dREgVI9rWEgdT4zqgkv6HCRsQGK1F3izEJr9mMXPiiNaNaOcaBxHv31saUtFQw== 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 79C0625A6C; Fri, 17 Jun 2022 19:41:36 +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 25HJfa0m030689; Fri, 17 Jun 2022 19:41:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJfa96030688; Fri, 17 Jun 2022 19:41:36 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:41:36 GMT Message-Id: <202206171941.25HJfa96030688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: ee3efd634115 - stable/13 - linux(4): Return ENOTSUP for unsupported clockid 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ee3efd634115cb25a9433f92e0397be5789b2ca4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494897; 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=/94FhElwbXG/VEl6MwvMd7/Mu+TydwgCeDU6xG9ESB0=; b=aZa3XDYzFbUI7z66Nu03pRZVeuk6g/MAb7bPaC5zyO/fbe+DZMgAUtpAyYo6MlY0D6lTm+ e/c0yIzy4AR3P0KMXAyIBknDY/RtYf9e/Qd4PAR+k0SdPbwsp6AkkHT1UbxDMiXS5RG2xf L9ZaGBuPgEsF/ZAUAH7YMb8RRr/kxr885zwVtMFua5HbyIT5pgvaPmPYuWCYyeg1nKx2Ue eVDgVCtluJDsZHZiy/wN9jQCDmfw6uHfEIuQbeHVsgkfJHRyoXAZ1mqrkQE4ou0dcy+Nxi Sl7tioNZt6jIfVAHUzjwC7r5nN7Uyp9F7y0wZ3NgKn+wzVuNcwaHxC4FjdUlRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494897; a=rsa-sha256; cv=none; b=mH4YEeCa+z7ZhbrLmptrDosD+x8ZNId7ytILvt8ih988s7ppDv9aJUleU5nZ0KXtiUxKNv OlkS3G/sqTFwO2t5LtzQSF0L977H1HMvsbIDnsLO9dGn49NOtCsS5Rd72PA8HJnrv6utYc uSYfvObCyXkA+93dDniI+BZPVrYVgcLuvM954X0ljBUh+H6ISfm1wC4CKFUT1axMfohz5O 0+uIEJdtfdeCXKPs+5t0QCFtRiK3cl6jAaG+DR8/vuZpFbV+6Hp+cX4whvizoTvEEgFuBi JIjohK7Jc/XS2uQf5/Tchf/yPRdz8ubwWaRP4YZLLq9IAU713xeXtI7cKj85dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=ee3efd634115cb25a9433f92e0397be5789b2ca4 commit ee3efd634115cb25a9433f92e0397be5789b2ca4 Author: Dmitry Chagin AuthorDate: 2022-05-31 08:43:00 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:35:41 +0000 linux(4): Return ENOTSUP for unsupported clockid It's much better from the user perspective to get a sane error code. MFC after: 2 weeks (cherry picked from commit 452f4636c3ba1f51f2f549ccc31fd4177254fb6d) --- sys/compat/linux/linux_time.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_time.c b/sys/compat/linux/linux_time.c index 0be7025abe05..5d2269190931 100644 --- a/sys/compat/linux/linux_time.c +++ b/sys/compat/linux/linux_time.c @@ -278,8 +278,11 @@ linux_to_native_clockid(clockid_t *n, clockid_t l) if (l < 0) { /* cpu-clock */ - if ((l & LINUX_CLOCKFD_MASK) == LINUX_CLOCKFD) - return (EINVAL); + if (LINUX_CPUCLOCK_WHICH(l) == LINUX_CLOCKFD) { + LIN_SDT_PROBE1(time, linux_to_native_clockid, + unsupported_clockid, l); + return (ENOTSUP); + } if (LINUX_CPUCLOCK_WHICH(l) >= LINUX_CPUCLOCK_MAX) return (EINVAL); @@ -319,11 +322,11 @@ linux_to_native_clockid(clockid_t *n, clockid_t l) case LINUX_CLOCK_TAI: LIN_SDT_PROBE1(time, linux_to_native_clockid, unsupported_clockid, l); - return (EINVAL); + return (ENOTSUP); default: LIN_SDT_PROBE1(time, linux_to_native_clockid, unknown_clockid, l); - return (EINVAL); + return (ENOTSUP); } return (0);