diff options
Diffstat (limited to 'fs/omfs/dir.c')
-rw-r--r-- | fs/omfs/dir.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c index c368360c35a1..3b8d3979e03b 100644 --- a/fs/omfs/dir.c +++ b/fs/omfs/dir.c | |||
@@ -241,11 +241,9 @@ static int omfs_remove(struct inode *dir, struct dentry *dentry) | |||
241 | int ret; | 241 | int ret; |
242 | 242 | ||
243 | 243 | ||
244 | if (S_ISDIR(inode->i_mode)) { | 244 | if (S_ISDIR(inode->i_mode) && |
245 | dentry_unhash(dentry); | 245 | !omfs_dir_is_empty(inode)) |
246 | if (!omfs_dir_is_empty(inode)) | 246 | return -ENOTEMPTY; |
247 | return -ENOTEMPTY; | ||
248 | } | ||
249 | 247 | ||
250 | ret = omfs_delete_entry(dentry); | 248 | ret = omfs_delete_entry(dentry); |
251 | if (ret) | 249 | if (ret) |
@@ -382,9 +380,6 @@ static int omfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
382 | int err; | 380 | int err; |
383 | 381 | ||
384 | if (new_inode) { | 382 | if (new_inode) { |
385 | if (S_ISDIR(new_inode->i_mode)) | ||
386 | dentry_unhash(new_dentry); | ||
387 | |||
388 | /* overwriting existing file/dir */ | 383 | /* overwriting existing file/dir */ |
389 | err = omfs_remove(new_dir, new_dentry); | 384 | err = omfs_remove(new_dir, new_dentry); |
390 | if (err) | 385 | if (err) |