mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 01:49:36 +00:00
vfs: rename: move d_move() up
Move the d_move() in vfs_rename_dir() up, similarly to how it's done in vfs_rename_other(). The next patch will consolidate these two functions and this is the only structural difference between them. I'm not sure if doing the d_move() after the dput is even valid. But there may be a logical explanation for that. But moving the d_move() before the dput() (and the mutex_unlock()) should definitely not hurt. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Reviewed-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
44b1d53043
commit
de22a4c372
1 changed files with 2 additions and 3 deletions
|
@ -4045,13 +4045,12 @@ static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
|
|||
target->i_flags |= S_DEAD;
|
||||
dont_mount(new_dentry);
|
||||
}
|
||||
if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE))
|
||||
d_move(old_dentry, new_dentry);
|
||||
out:
|
||||
if (target)
|
||||
mutex_unlock(&target->i_mutex);
|
||||
dput(new_dentry);
|
||||
if (!error)
|
||||
if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE))
|
||||
d_move(old_dentry,new_dentry);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue