From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 187CCC433C1 for ; Sat, 20 Mar 2021 18:03:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD75361949 for ; Sat, 20 Mar 2021 18:03:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbhCTSCp (ORCPT ); Sat, 20 Mar 2021 14:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229834AbhCTSCT (ORCPT ); Sat, 20 Mar 2021 14:02:19 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52C6AC061574; Sat, 20 Mar 2021 11:02:19 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id 61so12362954wrm.12; Sat, 20 Mar 2021 11:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Y34Z2sYEqx8+Z085rLmxqTJuYpOYKVEzZ/YVnvyeTMw=; b=kjIVkXJ36I2Qt7lurCEQEj5L5sCmC3RPd3qPDA2p54rNMEjTakL+NfUaKxYEm8yjRk RstI4aebJwc/nzQa1/YZ52BTb8gKWzAyFXyvwLbgOGyyKcL8NEWn4Tf6ySvt2k0o5TwR 6dRgS0hmIXx+nF3FjSEkU0xB2EPS0ShdTghz1dALh8e+Q46yTZQ+n0/qNZctIO394LW5 OOmAxwAriXNQLWY9XjffIqab1YHWf3FeF2dNhtXtxm6jnIguph3SJ5JLOFKP2FzYKQoe sonYLz4dHTdy+WYaFZJ4gZFSpHguw5/59PtF963oIUO/71eDyVsUrS86R2YeiLMhtxoS xS0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Y34Z2sYEqx8+Z085rLmxqTJuYpOYKVEzZ/YVnvyeTMw=; b=e1vBYmbuhS4bvAaHCzuKHdC+b5IfwkUuYAP0kMjhlzH1j9cP/dSJP1gvZt/jht8uR3 stp2VQ9rATgk/zwQhe3Cg0fiJBqIm33WJSSo4pZ0nvRay5iY5R6SRZsHT7Qs7lY67wo0 51+fuWqBDw3cDviGQ/GyjHYEUdEq5oYkKiJfzkLfIsJjf02I5BqJmfH4VkvTtKEa9Pqm Zgt9G1ZHPJtcKNaalM1T9d52v1COAnf0dTA9UH390J0LKwluWV9wmPbYnIdKnsPeSFud FFJzq8GAff12Ih2ofgPwyZ2lA2ZIm2/b5E6UctaATQ8RpsWRmoPtx3O2VOFGpNgOK/Sv rOqw== X-Gm-Message-State: AOAM531NHGfnvERLkZ2EdUcoaHdEB8XDBBR6HFR3OzZ6xRQwgyN7rQgK 85s8pGz95F9X7nlDFoTUDVg= X-Google-Smtp-Source: ABdhPJylyg7eaxr+BKrcNJy497vxnfEinjCT0Ga9qJs/+pT1JylGvI54hNs6dPk7Wt9nAfEeIq+U2A== X-Received: by 2002:a5d:640b:: with SMTP id z11mr9900833wru.327.1616263338023; Sat, 20 Mar 2021 11:02:18 -0700 (PDT) Received: from example.org (ip-94-113-225-162.net.upcbroadband.cz. [94.113.225.162]) by smtp.gmail.com with ESMTPSA id z1sm13926870wru.95.2021.03.20.11.02.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Mar 2021 11:02:17 -0700 (PDT) Date: Sat, 20 Mar 2021 19:02:14 +0100 From: Alexey Gladkov To: Alexey Dobriyan Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] proc: delete redundant subset=pid check Message-ID: <20210320180214.xxet7yjxivp4aiaq@example.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 20, 2021 at 06:46:08PM +0300, Alexey Dobriyan wrote: > Two checks in lookup and readdir code should be enough to not have > third check in open code. > > Can't open what can't be looked up? As far as I remember, I first added pidonly processing here and later then I disabled lookup. Now this is unnecessary. Acked-by: Alexey Gladkov > Signed-off-by: Alexey Dobriyan > --- > > fs/proc/inode.c | 4 ---- > 1 file changed, 4 deletions(-) > > --- a/fs/proc/inode.c > +++ b/fs/proc/inode.c > @@ -483,7 +483,6 @@ proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr, > > static int proc_reg_open(struct inode *inode, struct file *file) > { > - struct proc_fs_info *fs_info = proc_sb_info(inode->i_sb); > struct proc_dir_entry *pde = PDE(inode); > int rv = 0; > typeof_member(struct proc_ops, proc_open) open; > @@ -497,9 +496,6 @@ static int proc_reg_open(struct inode *inode, struct file *file) > return rv; > } > > - if (fs_info->pidonly == PROC_PIDONLY_ON) > - return -ENOENT; > - > /* > * Ensure that > * 1) PDE's ->release hook will be called no matter what > -- Rgrds, legion