summaryrefslogtreecommitdiff
path: root/fs/omfs/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/omfs/dir.c')
-rw-r--r--fs/omfs/dir.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c
index de4ff29f1e05..95ef4433d1a3 100644
--- a/fs/omfs/dir.c
+++ b/fs/omfs/dir.c
@@ -240,8 +240,12 @@ static int omfs_remove(struct inode *dir, struct dentry *dentry)
struct inode *inode = dentry->d_inode;
int ret;
- if (S_ISDIR(inode->i_mode) && !omfs_dir_is_empty(inode))
- return -ENOTEMPTY;
+
+ if (S_ISDIR(inode->i_mode)) {
+ dentry_unhash(dentry);
+ if (!omfs_dir_is_empty(inode))
+ return -ENOTEMPTY;
+ }
ret = omfs_delete_entry(dentry);
if (ret)