From nobody Sun Oct 10 09:24:21 2021 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 B3B1312DF5D0; Sun, 10 Oct 2021 09:24:26 +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 4HRxMY5s9hz3NJw; Sun, 10 Oct 2021 09:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 992573485; Sun, 10 Oct 2021 09:24:21 +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 19A9OLhH003587; Sun, 10 Oct 2021 09:24:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19A9OLr5003586; Sun, 10 Oct 2021 09:24:21 GMT (envelope-from git) Date: Sun, 10 Oct 2021 09:24:21 GMT Message-Id: <202110100924.19A9OLr5003586@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e858b9de8e99 - stable/13 - When sending ignored signal, arrange for zero return code from sleep 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e858b9de8e9988702ea0d895dc5182dee5e0c067 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e858b9de8e9988702ea0d895dc5182dee5e0c067 commit e858b9de8e9988702ea0d895dc5182dee5e0c067 Author: Konstantin Belousov AuthorDate: 2021-10-01 06:59:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-10 09:21:18 +0000 When sending ignored signal, arrange for zero return code from sleep (cherry picked from commit f17eb93d5540ec2bf422d96195820bba5021fa9c) --- sys/kern/kern_sig.c | 23 +++++++++++++---------- sys/kern/subr_sleepqueue.c | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 059c1716a89b..1aef62bb1cb2 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2233,17 +2233,20 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) return (ret); } else { action = SIG_CATCH; + intrval = 0; } - } else if (SIGISMEMBER(td->td_sigmask, sig)) - action = SIG_HOLD; - else if (SIGISMEMBER(ps->ps_sigcatch, sig)) - action = SIG_CATCH; - else - action = SIG_DFL; - if (SIGISMEMBER(ps->ps_sigintr, sig)) - intrval = EINTR; - else - intrval = ERESTART; + } else { + if (SIGISMEMBER(td->td_sigmask, sig)) + action = SIG_HOLD; + else if (SIGISMEMBER(ps->ps_sigcatch, sig)) + action = SIG_CATCH; + else + action = SIG_DFL; + if (SIGISMEMBER(ps->ps_sigintr, sig)) + intrval = EINTR; + else + intrval = ERESTART; + } mtx_unlock(&ps->ps_mtx); if (prop & SIGPROP_CONT) diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index b146a978a60c..a95c9a721f6f 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -1125,7 +1125,7 @@ sleepq_abort(struct thread *td, int intrval) THREAD_LOCK_ASSERT(td, MA_OWNED); MPASS(TD_ON_SLEEPQ(td)); MPASS(td->td_flags & TDF_SINTR); - MPASS(intrval == EINTR || intrval == ERESTART); + MPASS(intrval == 0 || intrval == EINTR || intrval == ERESTART); /* * If the TDF_TIMEOUT flag is set, just leave. A