Re: [PATCH v2 23/23] multipathd: fix signal blocking logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2018-03-06 at 08:16 +0100, Hannes Reinecke wrote:
> On 03/06/2018 12:15 AM, Martin Wilck wrote:
> > multipathd is supposed to block all signals in all threads, except
> > the uxlsnr thread which handles termination and reconfiguration
> > signals (SIGUSR1) in its ppoll() call, SIGUSR2 in the waiter thread
> > and the marginal path checker thread, and occasional SIGALRM. The
> > current
> > logic does exactly the oppsite, it blocks termination signals in
> > SIGPOLL and
> > allows multipathd to be killed e.g. by SIGALRM.
> > 
> > Fix that by inverting the logic. The argument to pthread_sigmask
> > and
> > ppoll is the set of *blocked* signals, not vice versa.
> > 
> > The marginal paths code needs to unblock SIGUSR2 now explicity, as
> > the dm-event waiter code already does. Doing this with pselect()
> > avoids asynchronous cancellation.
> > 
> > Fixes: 810082e "libmultipath, multipathd: Rework SIGPIPE handling"
> > Fixes: 534ec4c "multipathd: Ensure that SIGINT, SIGTERM, SIGHUP and
> > SIGUSR1
> > are delivered to the uxsock thread"
> > 
> > Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
> > ---
> >  libmultipath/io_err_stat.c | 17 ++++++++++++++++-
> >  multipathd/main.c          |  7 +++++--
> >  multipathd/uxlsnr.c        | 10 +++++-----
> >  3 files changed, 26 insertions(+), 8 deletions(-)
> > 
> 
> Sigh.
> Will we ever get signal handling correct?

I'm quite confident that we're close now.
But time will tell.

Martin

-- 
Dr. Martin Wilck <mwilck@xxxxxxxx>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux