Skip to contentSkip to conversation

AFFS fix return without releasing BKL

PATCH In review Dave Hansen 2 participants 3 messages Jul 11, 2002 – Jul 12, 2002 Affs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 AFFS fix return without releasing BKL

Linus,
This was found by Dan Carpenter <[email protected]>, using an smatch script. Looks to me like like an error caused during all the BKL pushing. 1 more coming...

Not tested (Greg, please don't hurt me :p )

Signature · 2 lines
Dave Hansen
[email protected]
fs/affs/namei.c +3 -1
@@ -345,8 +345,10 @@
 	lock_kernel();
 
 	/* WTF??? */
-	if (!dentry->d_inode)
+	if (!dentry->d_inode) {
+		unlock_kernel();
 		return -ENOENT;
+	}
 
 	res = affs_remove_header(dentry);
 	unlock_kernel();
#1 lore raw

Hi,

Quoted 3 lines · Dave Hansen

This was found by Dan Carpenter <[email protected]>, using an smatch script. Looks to me like like an error caused during all the BKL pushing. 1 more coming...

Actually lock_kernel() and the test there can be removed completely.

bye, Roman

#2 lore raw
Quoted 9 lines · Roman Zippel

Hi,

Quoted 3 lines · Dave Hansen

This was found by Dan Carpenter <[email protected]>, using an smatch script. Looks to me like like an error caused during all the BKL pushing. 1 more coming...

Actually lock_kernel() and the test there can be removed completely.

Patch attached to do just that.

Signature · 2 lines
Dave Hansen
[email protected]
fs/affs/namei.c +0 -7
@@ -342,14 +342,7 @@
 	pr_debug("AFFS: rmdir(dir=%u, \"%.*s\")\n", (u32)dir->i_ino,
 		 (int)dentry->d_name.len, dentry->d_name.name);
 
-	lock_kernel();
-
-	/* WTF??? */
-	if (!dentry->d_inode)
-		return -ENOENT;
-
 	res = affs_remove_header(dentry);
-	unlock_kernel();
 	return res;
 }