diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index d6c05c7176bc..5227e911eab2 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -1017,9 +1017,11 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, if (whiteout) { set_inode_flag(whiteout, FI_INC_LINK); err = f2fs_add_link(old_dentry, whiteout); - if (err) + if (err) { + d_invalidate(old_dentry); + d_invalidate(new_dentry); goto put_out_dir; - + } spin_lock(&whiteout->i_lock); whiteout->i_state &= ~I_LINKABLE; spin_unlock(&whiteout->i_lock);