VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Sage Weil <sage@newdream.net> 2011-05-24 13:06:06 -0700 committer: Al Viro <viro@zeniv.linux.org.uk> 2011-05-26 07:26:47 -0400 commit: 79bf7c732b5ff75b96022ed9d29181afd3d2509c parent: 64252c75a2196a0cf1e0d3777143ecfe0e3ae650
Commit Summary:
vfs: push dentry_unhash on rmdir into file systems
Diffstat:
1 file changed, 5 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)