Re: [PATCH v2 (v4.18 regression fix)] vfs: don't evict uninitialized inode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux