diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c index 3df2ed50ab57..54d33df06be0 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2262,8 +2262,11 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry) | |||
2262 | error = -EBUSY; | 2262 | error = -EBUSY; |
2263 | else { | 2263 | else { |
2264 | error = security_inode_unlink(dir, dentry); | 2264 | error = security_inode_unlink(dir, dentry); |
2265 | if (!error) | 2265 | if (!error) { |
2266 | error = dir->i_op->unlink(dir, dentry); | 2266 | error = dir->i_op->unlink(dir, dentry); |
2267 | if (!error) | ||
2268 | dentry->d_inode->i_flags |= S_DEAD; | ||
2269 | } | ||
2267 | } | 2270 | } |
2268 | mutex_unlock(&dentry->d_inode->i_mutex); | 2271 | mutex_unlock(&dentry->d_inode->i_mutex); |
2269 | 2272 | ||
@@ -2616,6 +2619,8 @@ static int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, | |||
2616 | else | 2619 | else |
2617 | error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry); | 2620 | error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry); |
2618 | if (!error) { | 2621 | if (!error) { |
2622 | if (target) | ||
2623 | target->i_flags |= S_DEAD; | ||
2619 | if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE)) | 2624 | if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE)) |
2620 | d_move(old_dentry, new_dentry); | 2625 | d_move(old_dentry, new_dentry); |
2621 | } | 2626 | } |