linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Reisner <philipp.reisner@linbit.com>
To: David Laight <David.Laight@aculab.com>
Cc: "Jens Axboe" <axboe@kernel.dk>,
	"'Christoph Böhmwalder'" <christoph.boehmwalder@linbit.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"Eric W . Biederman" <ebiederm@xmission.com>
Subject: Re: [PATCH] drbd: do not ignore signals in threads
Date: Mon, 12 Aug 2019 15:28:40 +0200	[thread overview]
Message-ID: <2789113.VEJ2NpTmzX@fat-tyre> (raw)
In-Reply-To: <1fcbb94c5f264c17af3394807438ad50@AcuMS.aculab.com>

Hi David,

[...]
> While our code is 'out of tree' (you really don't want it - and since
> it still uses force_sig() is fine) I suspect that the 'drdb' code
> (with Christoph's allow_signal() patch) now loops in kernel if a user
> sends it a signal.

I am not asking for that out of tree code. But you are welcome to learn
from the drbd code that is in the upstream kernel.
It does not loop if a root sends a signal, it receives it and ignores it.

> If the driver (eg drdb) is using (say) SIGINT to break a thread out of
> (say) a blocking kernel_accept() call then it can detect the unexpected
> signal (maybe double-checking with signal_pending()) but I don't think
> it can clear down the pending signal so that kernel_accept() blocks
> again.

You do that with flush_signals(current)

What we have do is, somewhere in the main loop:

  if (signal_pending(current)) {
			flush_signals(current);
			if (!terminate_condition()) {
				warn(connection, "Ignoring an unexpected signal\n");
				continue;
			}
			break;
		}
  }

-- 
LINBIT | Keeping The Digital World Running

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.




  reply	other threads:[~2019-08-12 13:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29  8:32 [PATCH] drbd: do not ignore signals in threads Christoph Böhmwalder
2019-07-29  8:50 ` David Laight
2019-08-05  9:33   ` Christoph Böhmwalder
2019-08-05  9:41     ` David Laight
2019-08-12 11:52       ` Philipp Reisner
2019-08-12 13:12         ` David Laight
2019-08-12 13:28           ` Philipp Reisner [this message]
2019-08-16 22:19             ` [PATCH] signal: Allow cifs and drbd to receive their terminating signals Eric W. Biederman
2019-08-19  8:37               ` Christoph Böhmwalder
2019-08-19 22:03                 ` [GIT PULL] " Eric W. Biederman
2019-08-19 23:35                   ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2789113.VEJ2NpTmzX@fat-tyre \
    --to=philipp.reisner@linbit.com \
    --cc=David.Laight@aculab.com \
    --cc=axboe@kernel.dk \
    --cc=christoph.boehmwalder@linbit.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).