From owner-svn-src-head@FreeBSD.ORG Mon Dec 8 16:33:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34339C9F; Mon, 8 Dec 2014 16:33:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2136BB0B; Mon, 8 Dec 2014 16:33:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB8GXIKK002212; Mon, 8 Dec 2014 16:33:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB8GXIwl002211; Mon, 8 Dec 2014 16:33:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412081633.sB8GXIwl002211@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 8 Dec 2014 16:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275618 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2014 16:33:19 -0000 Author: kib Date: Mon Dec 8 16:33:18 2014 New Revision: 275618 URL: https://svnweb.freebsd.org/changeset/base/275618 Log: Current reaction of the nfsd worker threads to any signal is exit. This is not correct at least for the stop requests. Check for stop conditions and suspend threads if requested. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/rpc/svc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Mon Dec 8 16:27:43 2014 (r275617) +++ head/sys/rpc/svc.c Mon Dec 8 16:33:18 2014 (r275618) @@ -1101,6 +1101,7 @@ svc_run_internal(SVCGROUP *grp, bool_t i SVCXPRT *xprt; enum xprt_stat stat; struct svc_req *rqstp; + struct proc *p; size_t sz; int error; @@ -1183,11 +1184,22 @@ svc_run_internal(SVCGROUP *grp, bool_t i > grp->sg_minthreads) && !st->st_xprt) break; - } else if (error) { + } else if (error != 0) { + KASSERT(error == EINTR || error == ERESTART, + ("non-signal error %d", error)); mtx_unlock(&grp->sg_lock); - svc_exit(pool); - mtx_lock(&grp->sg_lock); - break; + p = curproc; + PROC_LOCK(p); + if (P_SHOULDSTOP(p)) { + thread_suspend_check(0); + PROC_UNLOCK(p); + mtx_lock(&grp->sg_lock); + } else { + PROC_UNLOCK(p); + svc_exit(pool); + mtx_lock(&grp->sg_lock); + break; + } } continue; }