Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966281AbdGUCmB (ORCPT ); Thu, 20 Jul 2017 22:42:01 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:58474 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965991AbdGUCl6 (ORCPT ); Thu, 20 Jul 2017 22:41:58 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Oleg Nesterov Cc: linux-kernel@vger.kernel.org, Andy Lutomirski , Linus Torvalds , Al Viro , Andrei Vagin , Thomas Gleixner , Greg KH , Andrey Vagin , Serge Hallyn , Pavel Emelyanov , Cyrill Gorcunov , Peter Zijlstra , Willy Tarreau , linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Linux Containers , Michael Kerrisk References: <87o9shg7t7.fsf_-_@xmission.com> <20170718140651.15973-6-ebiederm@xmission.com> <20170720161603.GA14430@redhat.com> Date: Thu, 20 Jul 2017 21:33:52 -0500 In-Reply-To: <20170720161603.GA14430@redhat.com> (Oleg Nesterov's message of "Thu, 20 Jul 2017 18:16:04 +0200") Message-ID: <87lgni7c33.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1dYNt3-0006TR-86;;;mid=<87lgni7c33.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=67.3.213.87;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/utUFTJjCHg4IJSO4AYC02iZCm7PhjWJk= X-SA-Exim-Connect-IP: 67.3.213.87 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa08 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.2 T_XMDrugObfuBody_14 obfuscated drug references * 0.0 T_TooManySym_02 5+ unique symbols in subject X-Spam-DCC: XMission; sa08 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Oleg Nesterov X-Spam-Relay-Country: X-Spam-Timing: total 492 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 6 (1.1%), b_tie_ro: 4.1 (0.8%), parse: 1.00 (0.2%), extract_message_metadata: 2.3 (0.5%), get_uri_detail_list: 0.82 (0.2%), tests_pri_-1000: 3.7 (0.7%), tests_pri_-950: 0.87 (0.2%), tests_pri_-900: 0.75 (0.2%), tests_pri_-400: 19 (3.9%), check_bayes: 19 (3.8%), b_tokenize: 4.9 (1.0%), b_tok_get_all: 6 (1.3%), b_comp_prob: 1.28 (0.3%), b_tok_touch_all: 3.4 (0.7%), b_finish: 0.82 (0.2%), tests_pri_0: 447 (90.9%), check_dkim_signature: 0.39 (0.1%), check_dkim_adsp: 2.6 (0.5%), tests_pri_500: 3.3 (0.7%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 6/7] fcntl: Don't use ambiguous SIG_POLL si_codes X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1157 Lines: 45 Oleg Nesterov writes: > On 07/18, Eric W. Biederman wrote: >> >> - BUG_ON((reason & __SI_MASK) != __SI_POLL); >> + BUG_ON((reason < POLL_IN) || (reason > NSIGPOLL)); > ^^^^^^^^^^^^^^^^^ > looks obviously wrong? Say, POLL_IN is obviously > NSIGPOLL == 6. Strictly speaking that code is wrong until the next patch when I remove __SI_POLL. That is my mistake. When the values are not their messed up internal kernel variants the code works fine and makes sense. #define POLL_IN 1 /* data input available */ #define POLL_OUT 2 /* output buffers available */ #define POLL_MSG 3 /* input message available */ #define POLL_ERR 4 /* i/o error */ #define POLL_PRI 5 /* high priority input available */ #define POLL_HUP 6 /* device disconnected */ #define NSIGPOLL 6 > Probably you meant > > BUG_ON((reason < POLL_IN) || (reason - POLL_IN > NSIGPOLL) > > ? > > but this contradicts with the next line: >> if (reason - POLL_IN >= NSIGPOLL) >> si.si_band = ~0L; > > confused... I am mystified why we test for a condition that we have been bugging on for ages. Eric