Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2176795imm; Thu, 19 Jul 2018 14:46:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfN5/YrW4FHm3GTZULx5JNfoLT4ofc2SoCOsbIMnzM1xv8wF/EBp9TXk1+noKdx8tU0v854 X-Received: by 2002:aa7:83cd:: with SMTP id j13-v6mr11273845pfn.236.1532036775033; Thu, 19 Jul 2018 14:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532036775; cv=none; d=google.com; s=arc-20160816; b=TSy4CvXbvd2SF/GIqjIkEXiRotxvLkPZCZHncd3kP1t9uR/eFUCflGhBJMAop5HiSi RT8w+5Lb7rjpxVo8XVkeX8HFIHkPAwwopqMXGRh3a2NAcUkGin2aKMuSD3z4hS63gDG/ 7gUelrkDlkIUJIlx3vDxQ00NYAbbCPjYbOY/oHjuVxE/zJrsIE8mnS2P1FYhaoS4OoxQ tTUI08VMjqPT86F59zSc2mBxNxyzva5PiSAEbqBBOXy9KERFfeb1CthmgRKyKRHxNk7S 5aeGWUGO1+98meLK38abrNKOI5qvKtzFKlfHpo+67jPaXV0MAapOrhzfYjjP1TfUXlT2 Dilw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=vDzvu6ib8u6ZtzSNHemOsDobaeMWg+ZwamKJ11OIPHg=; b=NjQJrl22XLfhhqUbSAvNqXws3ukwzFlL+4caq6fxxqxdqKv5LecD0JR4v/KhUaq6xL HEDyLOm85dX/YfqsiovstSIMEHA0xtCLhR9JXetGSOdn3l9YLDf9/i1aW7T6wrArLY5k NvDM1IQb+mSfnqfqXOrJraFnk6HAI19IpTAD98lw6NT4eejVJGQqs7kjMx4TUHoynigb sgkQ/yZUvZqd258EeVzOAGk4kfheYQmKdpTRPB8K49KbfyXbXq53hay7bX893pj6gudG CND+zP4oICaXIC7QkzGWkOmCW1lcOFk3mOyn9Fo1LuVIx1OxyruPc71g8rGyX6PhqZx5 lCVw== 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 u6-v6si188836plr.437.2018.07.19.14.46.00; Thu, 19 Jul 2018 14:46:15 -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 S1730713AbeGSWaY (ORCPT + 99 others); Thu, 19 Jul 2018 18:30:24 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:44846 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727721AbeGSWaY (ORCPT ); Thu, 19 Jul 2018 18:30:24 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fgGjg-00068r-1e; Thu, 19 Jul 2018 21:45:20 +0000 Date: Thu, 19 Jul 2018 22:45:20 +0100 From: Al Viro To: Miklos Szeredi Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 (v4.18 regression fix)] vfs: don't evict uninitialized inode Message-ID: <20180719214519.GA23379@ZenIV.linux.org.uk> References: <20180706204521.29654-1-mszeredi@redhat.com> <20180718121833.GR30522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180718121833.GR30522@ZenIV.linux.org.uk> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 18, 2018 at 01:18:33PM +0100, Al Viro wrote: > BTW, why have you left generic_readlink() sitting around? AFAICS, > it could've been folded into the only remaining caller just as > you've made it static in late 2016... I'll fold it in; > just curious what was the reason for not doing that back then... BTW^2: const char *vfs_get_link(struct dentry *dentry, struct delayed_call *done) { const char *res = ERR_PTR(-EINVAL); struct inode *inode = d_inode(dentry); if (d_is_symlink(dentry)) { res = ERR_PTR(security_inode_readlink(dentry)); if (!res) res = inode->i_op->get_link(dentry, inode, done); } return res; } hits a method call that is not needed in the majority of cases. Is there any subtle reason why it shouldn't be const char *vfs_get_link(struct dentry *dentry, struct delayed_call *done) { const char *res = ERR_PTR(-EINVAL); struct inode *inode = d_inode(dentry); if (d_is_symlink(dentry)) { res = ERR_PTR(security_inode_readlink(dentry)); if (!res) res = inode->i_link; if (!res) res = inode->i_op->get_link(dentry, inode, done); } return res; } instead?