vfs: push dentry_unhash on rename_dir into file systems
[linux-3.10.git] / fs / fat / namei_msdos.c
index 0c25cea..c3eccbd 100644 (file)
@@ -459,6 +459,9 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
        old_inode = old_dentry->d_inode;
        new_inode = new_dentry->d_inode;
 
+       if (new_inode && S_ISDIR(new_inode->i_mode))
+               dentry_unhash(new_dentry);
+
        err = fat_scan(old_dir, old_name, &old_sinfo);
        if (err) {
                err = -EIO;