Skip to content

Commit 9c50eaf

Browse files
committed
Merge branch 'work.rmdir' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull rmdir update from Al Viro: "More shrink_dcache_parent()-related stuff - killing the main source of potentially contended calls of that on large subtrees" * 'work.rmdir' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: rmdir(),rename(): do shrink_dcache_parent() only on success
2 parents 06c86e6 + 8767712 commit 9c50eaf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/namei.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3852,11 +3852,11 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry)
38523852
if (error)
38533853
goto out;
38543854

3855-
shrink_dcache_parent(dentry);
38563855
error = dir->i_op->rmdir(dir, dentry);
38573856
if (error)
38583857
goto out;
38593858

3859+
shrink_dcache_parent(dentry);
38603860
dentry->d_inode->i_flags |= S_DEAD;
38613861
dont_mount(dentry);
38623862
detach_mounts(dentry);
@@ -4439,8 +4439,6 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
44394439
old_dir->i_nlink >= max_links)
44404440
goto out;
44414441
}
4442-
if (is_dir && !(flags & RENAME_EXCHANGE) && target)
4443-
shrink_dcache_parent(new_dentry);
44444442
if (!is_dir) {
44454443
error = try_break_deleg(source, delegated_inode);
44464444
if (error)
@@ -4457,8 +4455,10 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
44574455
goto out;
44584456

44594457
if (!(flags & RENAME_EXCHANGE) && target) {
4460-
if (is_dir)
4458+
if (is_dir) {
4459+
shrink_dcache_parent(new_dentry);
44614460
target->i_flags |= S_DEAD;
4461+
}
44624462
dont_mount(new_dentry);
44634463
detach_mounts(new_dentry);
44644464
}

0 commit comments

Comments
 (0)