Re: [PATCH v2] proc/sysctl: don't return ENOMEM on lookup when a table is unregistering

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

 



On Thu, Dec 13, 2018 at 03:20:52PM -0800, Ivan Delalande wrote:

> @@ -474,7 +474,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb,
>  	if (unlikely(head->unregistering)) {
>  		spin_unlock(&sysctl_lock);
>  		iput(inode);
> -		inode = NULL;
> +		inode = ERR_PTR(-ENOENT);
>  		goto out;
>  	}

Applied, with one modification: if you look at the target of that goto,
you'll see
out:
        return inode;
so this place should be simply
 		spin_unlock(&sysctl_lock);
 		iput(inode);
		return ERR_PTR(-ENOENT);
	}

That way the label becomes unused and goes away.



[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