Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2241830pxf; Sat, 20 Mar 2021 08:49:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwiUGB8TTzoTN3dAkJu7wz+L982CT6TOs5/giWm0qfc3CdTAq5Im2lUzvLaGMiRMHKzm5N X-Received: by 2002:a17:906:85b:: with SMTP id f27mr10633580ejd.414.1616255397100; Sat, 20 Mar 2021 08:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616255397; cv=none; d=google.com; s=arc-20160816; b=A1MOW9+8XKqbNfss3nEyIlFNF5oj/5ttBOO3P6yVZjom1qmbS3amRpsBiBiCj0DA8q SeIVrbxh3BYaIQvLD7q7B2PTWyfQbeH1lQq6IpfBL8D8G5YfYUbqeL1+djxrJlN8Egcg TyMDlR7C7B+dhYbtdmdI5Ty8Lm5/OE2IJW6zq6TRr8phhDizy7Ddq3wI8lH1Hb+dF1II a2k5fkAzA9VjU8Ny4QWUm4j+ev+dqoEQ0y7cQlZ4zLixTvq3O1VXBtIboDpbc7V9GekE 7SOHIbJZ1CVhHQbDMB/MU//UkfUUlAPrm7romZk12tU7MyDRTUMKi3m1hzIleeCfGcS+ C4Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=stA9eMTsiClMTTVbDXG9ikJ8gl/7VEUDLTDJT6ZFsMs=; b=ThnOmwM6RgeMmvFcPwL2EShD8SchSsVqe7arF4dCVxXFtb6HmzVUZLKgpk4QPFxoGO davT1V7NtkeQcIVNhWfIAejlfYcBBmWZb0zRzR16GI3dtYdRPEfgOQHpbw6l8Hr1OTAK vM8THXlrgZ5ZgcHyJEL6Va2SI0R39uRyRtDVp7SBFYcIeHgOI+RO+UX0d4qX73HVhKlh SYageogTS3pWpByUMoXP69cRs2SxfLxzjnqn8ag3EvR8XX+c2ghrBIYxwqRMzv3rmaFf yDWY79EQAa2L0cHeaJWnqmqKZS2r9cCNqgq0xGq1o0wPk7jOYXfnRIU1Fljx3PELNYRg 8bSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RACW76s6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si7370356ejb.114.2021.03.20.08.49.34; Sat, 20 Mar 2021 08:49:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RACW76s6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbhCTPq3 (ORCPT + 99 others); Sat, 20 Mar 2021 11:46:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbhCTPqM (ORCPT ); Sat, 20 Mar 2021 11:46:12 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA033C061574; Sat, 20 Mar 2021 08:46:11 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id u5so14393041ejn.8; Sat, 20 Mar 2021 08:46:11 -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:mime-version:content-disposition; bh=stA9eMTsiClMTTVbDXG9ikJ8gl/7VEUDLTDJT6ZFsMs=; b=RACW76s6YnIVeZwc7956uumK/HRcBwuVNnT5bq2UupIGQkV4SynucRbhXHBnn4ZSih k65pa4hYTnkNvCQ9+WtIJB8+mpZ8SKP3Wfo1yq5ncSEf7yC+eV6T4WSzwhj/Yvggj45a HDaskvoZg5lVWzepFqoDr9P/DBunNoOnj8UJgkNFVFehOC3gRVCDrmf+2tDBODMPQdBJ qNwOQyCLzCwXOWMHgW1fAe7Au/ScP4x9gXBP6Z8tdEtQOmb/Sy2O7EJjI3y7CgvqOR4x t+Zp9C+SIXvzCxygCnEakdXB1AAMgVLauuavgzMNXvguuSfuGegSS7aOFqm9Ku8x9t7a snVQ== 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:mime-version :content-disposition; bh=stA9eMTsiClMTTVbDXG9ikJ8gl/7VEUDLTDJT6ZFsMs=; b=FMRTpsbxqR51SHV/x0s4kS8piRU7lMSWzEOvQiJyNE4A8XkAqpHJXHH4Ly5ih9ielP o/DjuoeJC0WwAG9gpN/nPSImfGTEW4evZ089XP6dFrRpZT4IQ9hODK7AbCs/jrE9lZT6 qGUMTHiILpU2xsvbEM+7eTMHBOufEQeIKUTKOrT7gRiiIlX+cI3RMpMkVW2gMd+5kmeY cungSDO9gFQKr9xWkYFYz4BYNajcYTlJwbvwF0vHrod3KypKxexBR5UohvNChtSpzKs9 ZO/FBxqNZyWTXWeI71AnIMIWQZjgSn7JD6kSyHMeFvly3hM9x8T99qbWIM7cKnqMdNSv JGpg== X-Gm-Message-State: AOAM5327rtdz4MDIbKI3aAe4noOMMXWlqRdoxjxm7I6G4j8e8mM153vW wuHFJTvjWfASCALY4BDwsG/MNEAaXg== X-Received: by 2002:a17:907:20e4:: with SMTP id rh4mr10368501ejb.369.1616255170315; Sat, 20 Mar 2021 08:46:10 -0700 (PDT) Received: from localhost.localdomain ([46.53.248.213]) by smtp.gmail.com with ESMTPSA id t14sm5410736ejc.121.2021.03.20.08.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Mar 2021 08:46:10 -0700 (PDT) Date: Sat, 20 Mar 2021 18:46:08 +0300 From: Alexey Dobriyan To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, gladkov.alexey@gmail.com Subject: [PATCH] proc: delete redundant subset=pid check Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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