Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6565724ybi; Wed, 5 Jun 2019 03:01:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhkUixxslLUKRyPSaY0SDSlWIu6Rw0M4FguSVWEH3TS7mFfUfGjaQpRO2DL7PCEv95fNey X-Received: by 2002:a62:29c7:: with SMTP id p190mr44160736pfp.218.1559728860743; Wed, 05 Jun 2019 03:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559728860; cv=none; d=google.com; s=arc-20160816; b=N8C5zcq60qYX/BnT8/WpQVIqUwj9aoquPPNDLirDWgoGVbPrJoxLQ5gnhQ41kPzBtZ xSc0sPF2bPybgxCw1FxndglC0ZTfzm3w1crJaPjD/vNO8+yJks5+t96+jKTiBFwlP8uS k+2VlPLSauvKNIHvfl30X3T3zhFvqxE4lUqiE0xpfUSeSE5Xav0nWkI6V3oHkqFoB1Fu 6Pf3RI2zNCqguFS7OwAgMuQ23umtyXuJFtYukARqQjD3Cd81M5qHhGdWv+Rfo/Knpx3f Vr9I16ubbEwUqSCjToHGl6iLesVnMBHde1uAvJ5pub9WcFKv5IoP5dyiu3YPmNbItJqg C32w== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=Bkg9bJJw/WYIeVW/TTnXTvt6Q4M0QjFNJtTuSfEr1Ig=; b=fU8a2qRR+WcNVZR6KQHdLXDzcSdcOUmB1vamywnKeUUyDoCbQQMXY0KJ2UznaMAYFd fT/JUc6dTQuDaV9dXhiBnj6HOS6qd+tVHEBF+khuFot6e532Zvjr0WKpOxZaDnxcS9MB vmgdMnnHrgYciacQKNwtMZbbIwxmMVBTxUb8IBMxEG9Fd5w1RkA5SnvI07K4LbXBlZqr A67Iumuu+0birX3e41KDJKMUtbiyJ9wBL1fgUiF1l45yCieZZynpaMU9ex0cgrxj/JUf rwWxJ+eyRuccwQgU60h3nGv2cL0V1JcmE/J4BufzU8sV0ezPkkH9sYu3717FV3zppAyu sYeA== ARC-Authentication-Results: i=1; mx.google.com; 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 r23si26683616pgj.234.2019.06.05.03.00.42; Wed, 05 Jun 2019 03:01:00 -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; 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 S1727195AbfFEJ6a convert rfc822-to-8bit (ORCPT + 99 others); Wed, 5 Jun 2019 05:58:30 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([146.101.78.151]:44818 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727071AbfFEJ6a (ORCPT ); Wed, 5 Jun 2019 05:58:30 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-7-CFkA386iP16q3G7kxRKBCw-1; Wed, 05 Jun 2019 10:58:25 +0100 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b::d117) by AcuMS.aculab.com (fd9f:af1c:a25b::d117) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 5 Jun 2019 10:58:25 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Wed, 5 Jun 2019 10:58:25 +0100 From: David Laight To: 'Oleg Nesterov' CC: 'Linus Torvalds' , Andrew Morton , Deepa Dinamani , "Linux List Kernel Mailing" , Arnd Bergmann , Davidlohr Bueso , Jens Axboe , Davidlohr Bueso , "e@80x24.org" , Jason Baron , linux-fsdevel , "linux-aio@kvack.org" , "omar.kilani@gmail.com" , Thomas Gleixner , stable , Al Viro , "Eric W. Biederman" Subject: RE: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask() Thread-Topic: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask() Thread-Index: AQHVGxwzwFf0q/qAAkiR7PRGfFAGAqaMwPEw///5P4CAABTbsA== Date: Wed, 5 Jun 2019 09:58:25 +0000 Message-ID: <29dd2937475b4407b617e2516f9cdd05@AcuMS.aculab.com> References: <20190522032144.10995-1-deepa.kernel@gmail.com> <20190529161157.GA27659@redhat.com> <20190604134117.GA29963@redhat.com> <263d0e478ee447d9aa10baab0d8673a5@AcuMS.aculab.com> <20190605092516.GC32406@redhat.com> In-Reply-To: <20190605092516.GC32406@redhat.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: CFkA386iP16q3G7kxRKBCw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oleg Nesterov [mailto:oleg@redhat.com] > Sent: 05 June 2019 10:25 > On 06/05, David Laight wrote: > > > > epoll() would have: > > if (restore_user_sigmask(xxx.sigmask, &sigsaved, !ret || ret == -EINTR)) > > ret = -EINTR; > > I don't think so but lets discuss this later. I certainly think there should be some comments at least about when/whether signal handlers get called and that being separate from the return value. The system call restart stuff does seem strange. ISTR that was originally added for SIG_SUSPEND (^Z) so that those signals wouldn't be seen by the appication. But that makes it a property of the signal, not the system call. > > I also think it could be simplified if code that loaded the 'user sigmask' > > saved the old one in 'current->saved_sigmask' (and saved that it had done it). > > You'd not need 'sigsaved' nor pass the user sigmask address into > > the restore function. > > Heh. apparently you do not read my emails ;) > > This is what I proposed in my very 1st email, and I even showed the patch > and the code with the patch applied twice. Let me do this again. I did read that one, I've even quoted it in the past :-) It's just not been mentioned recently. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)