Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3791294ybl; Mon, 12 Aug 2019 06:30:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlndevb4bYLaMoD7ZeG8Am7OjpbJQisMDYGKKhSceTETmcMIopUOkkMwyiPhx9xQccIr4S X-Received: by 2002:a63:221f:: with SMTP id i31mr30824298pgi.251.1565616633471; Mon, 12 Aug 2019 06:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565616633; cv=none; d=google.com; s=arc-20160816; b=AbYI6dbv+TV45+K0OVYLlp7nC/AI//eFxpcx5jVZX5RWGAj1NWbuV0kYL3meBDGoYW r3TdMXx3s8mLad2Ux8PUyG3B2sBdBhPolf20pCxMZ+VixFiZeJCQTiD/s/V2tCvdNRTN vJM8Vf5Aw8SEbuOMDXVQ67N1BxrkegCI+BuBv9198gvBBAb/luqNwkW0nstRVycg11xJ Y3uIzo3/z80qOvSbZzqwHNUGFRApKELAegxDMDFoOWUmT3MhXm5kOVBh0SOjZY2BeHQz aBk9yxzbXrr9Vc6PqIPDHONTX6tmukobRAU/95xj3Yic9YVnlGauKP8hqhVr/p4r+2AC rKTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bTg0D8gCcPG/JWmmX96yNXeO3DHquJW5Hs2qALYKWxs=; b=J0SYDyvRMbCwPqGnugyJLaMeQcdUVyYBvedZPwiGDrXC5pcrkkxwk+OygR9F6NLYXB 4p2TjUHVLJybOmUI1d1Qk6vJcbkOZiZfEnF5CU6Xq7Q+XP6WS/SjXZtVKDsWQEk5aTdl TJHM2qi7AErkguXLdHGE7mFcUFkP4XfJhUbRRQb0/21/OSiFL/j5VKRL6RHUtMTFqNR/ orgml+MfOb8isrO1c6eSHR69sdaBBAhN/IMj2UljIVBGaxuPJgDVL1x9ysH2ceHQ/tFg wNyX5gyiG9eZU6kpUZkCdsP34ZnBMW89CRpKPaL9vs7yf48s8H9Q+B2ojV7qjgjqLv70 0yew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linbit-com.20150623.gappssmtp.com header.s=20150623 header.b=SFMQ3KM3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l2si12074214pjw.0.2019.08.12.06.30.17; Mon, 12 Aug 2019 06:30:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linbit-com.20150623.gappssmtp.com header.s=20150623 header.b=SFMQ3KM3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728912AbfHLN2o (ORCPT + 99 others); Mon, 12 Aug 2019 09:28:44 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52344 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728705AbfHLN2o (ORCPT ); Mon, 12 Aug 2019 09:28:44 -0400 Received: by mail-wm1-f65.google.com with SMTP id s3so12183947wms.2 for ; Mon, 12 Aug 2019 06:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bTg0D8gCcPG/JWmmX96yNXeO3DHquJW5Hs2qALYKWxs=; b=SFMQ3KM36HmwXFALuuEhARJ+72KsCWPKLULLLUZjmohl1bYPWj6f+aj9313omcBxxh 8y25z8oTlYZFtkI4GRsxOQm6wy/vqeW4WsZhCg1psKUs3giA2C6JKBAGyWKQ0ymR9KMe 1YXobo5NIgvhKRf7GYMofDs0oyVNYOIAFS1mFfv+f/eK25aFVlv1qeZuBx/1vHQJ98Zz fLhG3DATXHq2U1bYzD80l0wzhxNV/nD2Cti355fsh+/crFu3O1JD9Jv0M1Yn1ML4uJ4C eZhsItAWowF+ev2D1aQJn7ObpEgq9kOPsrMzNuvup7h6qARV/wax9RMfahNApjUX1fbb krQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bTg0D8gCcPG/JWmmX96yNXeO3DHquJW5Hs2qALYKWxs=; b=qm7HUqYC4SbDrnBImA94Ulmpgu06vrPCMPuDlcDwQtZjiFnpY6N2kt0tzrJtKelI+o slpml4uG3WjHaqdnWZNh/m/0Ovqdb6nb4DDnf2hzBnMmkpD3zIEnGD+7MrDUbjOMXaem Ooo9boRPbo8PiYhH+nEL8Hh40vsNSFuyI+RLn6IxivbYAVlWKVyPJdCaT5+oBN1Jx33n y5mDROB7vcAQihePeipxU66ickP6GeEdyETcd7ABWic3aNpSs1vbPUnbavewbKx0I3y/ xwzJxuk/flCgtmWjDwrYET6q8wiqWHPuONRog+bw8jW+WTl+MIC1L9dHsFpN1QNxVxPV oYAg== X-Gm-Message-State: APjAAAVxjeSy8YBCxeJIl6mWGXF9N6G8JG3/+tp+59N1lqNeUsXmhhlx NeygiKyWxZ+zMi36FW4BQVGMMQ== X-Received: by 2002:a7b:c947:: with SMTP id i7mr28764649wml.77.1565616522204; Mon, 12 Aug 2019 06:28:42 -0700 (PDT) Received: from fat-tyre.localnet ([2001:858:107:1:7139:36a7:c14f:e911]) by smtp.gmail.com with ESMTPSA id e13sm10539700wmh.44.2019.08.12.06.28.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 06:28:41 -0700 (PDT) From: Philipp Reisner To: David Laight Cc: Jens Axboe , 'Christoph =?ISO-8859-1?Q?B=F6hmwalder=27?= , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , "Eric W . Biederman" Subject: Re: [PATCH] drbd: do not ignore signals in threads Date: Mon, 12 Aug 2019 15:28:40 +0200 Message-ID: <2789113.VEJ2NpTmzX@fat-tyre> In-Reply-To: <1fcbb94c5f264c17af3394807438ad50@AcuMS.aculab.com> References: <20190729083248.30362-1-christoph.boehmwalder@linbit.com> <1761552.9xIroHqhk7@fat-tyre> <1fcbb94c5f264c17af3394807438ad50@AcuMS.aculab.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } } =2D-=20 LINBIT | Keeping The Digital World Running DRBD=AE and LINBIT=AE are registered trademarks of LINBIT, Austria.