Re: [RFC][PATCH] rmdir(),rename(): do shrink_dcache_parent() only on success

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

 



On Sun, May 27, 2018 at 08:14:30PM -0600, Andreas Dilger wrote:

> > 	if (!(flags & RENAME_EXCHANGE) && target) {
> > -		if (is_dir)
> > +		if (is_dir) {
> > +			shrink_dcache_parent(new_dentry);
> > 			target->i_flags |= S_DEAD;
> 
> Would it be better to set S_DEAD on the removed directory before
> shrink_dcache_parent() is called (here and in vfs_rmdir()), or is
> there no way for a new dentry to be added to the parent after the
> shrink is done?

It's locked (exclusive).  Lookups (as well as readdir preseeding
of dcache in case of filesystems that do it) are under the same
lock held at least shared.  The same goes for all IS_DEADDIR callers -
exact same locking is used for S_DEAD handling as well.  So the order
really doesn't matter here.



[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