summaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2/namei.c')
-rw-r--r--fs/nilfs2/namei.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
index 78306e6..1102a5f 100644
--- a/fs/nilfs2/namei.c
+++ b/fs/nilfs2/namei.c
@@ -371,6 +371,9 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct nilfs_transaction_info ti;
int err;
+ if (new_inode && S_ISDIR(new_inode->i_mode))
+ dentry_unhash(new_dentry);
+
err = nilfs_transaction_begin(old_dir->i_sb, &ti, 1);
if (unlikely(err))
return err;
OpenPOWER on IntegriCloud