From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f67.google.com ([209.85.218.67]:46806 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727631AbeGTJTs (ORCPT ); Fri, 20 Jul 2018 05:19:48 -0400 Received: by mail-oi0-f67.google.com with SMTP id y207-v6so19942711oie.13 for ; Fri, 20 Jul 2018 01:32:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180719214519.GA23379@ZenIV.linux.org.uk> References: <20180706204521.29654-1-mszeredi@redhat.com> <20180718121833.GR30522@ZenIV.linux.org.uk> <20180719214519.GA23379@ZenIV.linux.org.uk> From: Miklos Szeredi Date: Fri, 20 Jul 2018 10:32:37 +0200 Message-ID: Subject: Re: [PATCH v2 (v4.18 regression fix)] vfs: don't evict uninitialized inode To: Al Viro Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Jul 19, 2018 at 11:45 PM, Al Viro wrote: > 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? Can't see any issues. But I also don't think any of the callers are seriously performance sensitive, so I guess it basically doesn't matter. Thanks, Miklos