diff options
Diffstat (limited to 'fs/sysv/namei.c')
-rw-r--r-- | fs/sysv/namei.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c index e474fbcf8bde..e2cc6756f3b1 100644 --- a/fs/sysv/namei.c +++ b/fs/sysv/namei.c | |||
@@ -196,6 +196,8 @@ static int sysv_rmdir(struct inode * dir, struct dentry * dentry) | |||
196 | struct inode *inode = dentry->d_inode; | 196 | struct inode *inode = dentry->d_inode; |
197 | int err = -ENOTEMPTY; | 197 | int err = -ENOTEMPTY; |
198 | 198 | ||
199 | dentry_unhash(dentry); | ||
200 | |||
199 | if (sysv_empty_dir(inode)) { | 201 | if (sysv_empty_dir(inode)) { |
200 | err = sysv_unlink(dir, dentry); | 202 | err = sysv_unlink(dir, dentry); |
201 | if (!err) { | 203 | if (!err) { |
@@ -222,6 +224,9 @@ static int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, | |||
222 | struct sysv_dir_entry * old_de; | 224 | struct sysv_dir_entry * old_de; |
223 | int err = -ENOENT; | 225 | int err = -ENOENT; |
224 | 226 | ||
227 | if (new_inode && S_ISDIR(new_inode->i_mode)) | ||
228 | dentry_unhash(new_dentry); | ||
229 | |||
225 | old_de = sysv_find_entry(old_dentry, &old_page); | 230 | old_de = sysv_find_entry(old_dentry, &old_page); |
226 | if (!old_de) | 231 | if (!old_de) |
227 | goto out; | 232 | goto out; |