Re: [PATCH v2 7/7] Use simple_start_creating() in various places.

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

 



On Tue, Sep 09, 2025 at 02:43:21PM +1000, NeilBrown wrote:

>  	d_instantiate(dentry, inode);
> -	dget(dentry);
> -fail:
> -	inode_unlock(d_inode(parent));
> -	return dentry;
> +	return simple_end_creating(dentry);

No.  This is the wrong model - dget() belongs with d_instantiate()
here; your simple_end_creating() calling conventions are wrong.

What really happens is a controlled leak.  simple_start_creating()
in the beginning is correct, but the right model here is to have
identical refcounting logics on the exits - the only difference
should be in having done that combination on success.

Please, leave those alone for now.




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

  Powered by Linux