From owner-svn-src-projects@freebsd.org Wed Apr 24 16:28:52 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F14F7159D36B for ; Wed, 24 Apr 2019 16:28:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 13DC56D662; Wed, 24 Apr 2019 16:28:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x3OGSbc3058842 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 24 Apr 2019 19:28:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x3OGSbc3058842 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x3OGSbOV058841; Wed, 24 Apr 2019 19:28:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 24 Apr 2019 19:28:37 +0300 From: Konstantin Belousov To: Alan Somers Cc: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: Re: svn commit: r346640 - in projects/fuse2/sys: fs/fuse kern Message-ID: <20190424162837.GD12936@kib.kiev.ua> References: <201904241554.x3OFsIjw024483@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904241554.x3OFsIjw024483@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2019 16:28:52 -0000 On Wed, Apr 24, 2019 at 03:54:18PM +0000, Alan Somers wrote: > Author: asomers > Date: Wed Apr 24 15:54:18 2019 > New Revision: 346640 > URL: https://svnweb.freebsd.org/changeset/base/346640 > > Log: > fusefs: interruptibility improvements suggested by kib > > * Block stop signals in fticket_wait_answer This might be ok, but consider using VFCF_SBDRY. > * Hold ps_mtx while checking signal disposition This part is pointless, as explained before. > * style(9) changes And sig_isfatal() is still there, which I consider an architectural bug. > > PR: 346357 > Reported by: kib > Sponsored by: The FreeBSD Foundation > > Modified: > projects/fuse2/sys/fs/fuse/fuse_ipc.c > projects/fuse2/sys/kern/kern_sig.c > > Modified: projects/fuse2/sys/fs/fuse/fuse_ipc.c > ============================================================================== > --- projects/fuse2/sys/fs/fuse/fuse_ipc.c Wed Apr 24 15:35:29 2019 (r346639) > +++ projects/fuse2/sys/fs/fuse/fuse_ipc.c Wed Apr 24 15:54:18 2019 (r346640) > @@ -430,10 +430,11 @@ fticket_wait_answer(struct fuse_ticket *ftick) > { > struct thread *td = curthread; > sigset_t blockedset, oldset; > - int err = 0; > + int err = 0, stops_deferred; > struct fuse_data *data; > - SIGEMPTYSET(blockedset); > > + SIGEMPTYSET(blockedset); > + stops_deferred = sigdeferstop(SIGDEFERSTOP_SILENT); > kern_sigprocmask(td, SIG_BLOCK, NULL, &oldset, 0); > > fuse_lck_mtx_lock(ftick->tk_aw_mtx); > @@ -476,6 +477,7 @@ retry: > * or EAGAIN to the interrupt. > */ > int sig; > + bool fatal; > > SDT_PROBE2(fusefs, , ipc, trace, 4, > "fticket_wait_answer: interrupt"); > @@ -485,11 +487,12 @@ retry: > PROC_LOCK(td->td_proc); > mtx_lock(&td->td_proc->p_sigacts->ps_mtx); > sig = cursig(td); > + fatal = sig_isfatal(td->td_proc, sig); > mtx_unlock(&td->td_proc->p_sigacts->ps_mtx); > PROC_UNLOCK(td->td_proc); > > fuse_lck_mtx_lock(ftick->tk_aw_mtx); > - if (!sig_isfatal(td->td_proc, sig)) { > + if (!fatal) { > /* > * Block the just-delivered signal while we wait for an > * interrupt response > @@ -512,6 +515,7 @@ out: > err = ENXIO; > } > fuse_lck_mtx_unlock(ftick->tk_aw_mtx); > + sigallowstop(stops_deferred); > > return err; > } > > Modified: projects/fuse2/sys/kern/kern_sig.c > ============================================================================== > --- projects/fuse2/sys/kern/kern_sig.c Wed Apr 24 15:35:29 2019 (r346639) > +++ projects/fuse2/sys/kern/kern_sig.c Wed Apr 24 15:54:18 2019 (r346640) > @@ -929,16 +929,16 @@ osigreturn(struct thread *td, struct osigreturn_args * > #endif > #endif /* COMPAT_43 */ > > -/* Will this signal be fatal to the current process ? */ > +/* Would this signal be fatal to the current process, if it were caught ? */ > bool > sig_isfatal(struct proc *p, int sig) > { > intptr_t act; > + int prop; > > + mtx_assert(&p->p_sigacts->ps_mtx, MA_OWNED); > act = (intptr_t)p->p_sigacts->ps_sigact[_SIG_IDX(sig)]; > if ((intptr_t)SIG_DFL == act) { > - int prop; > - > prop = sigprop(sig); > return (0 != (prop & (SIGPROP_KILL | SIGPROP_CORE))); > } else {