Skip to contentSkip to conversation

knfsd: check for existence of file_lock parameter inside of the kernel lock.

PATCH Matthew Wilcox 1 participant 1 message Jan 7, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Linux Kernel Mailing List

ChangeSet 1.2177, 2005/01/04 21:48:59-08:00, [email protected]

[PATCH] knfsd: check for existence of file_lock parameter inside of the kernel lock.

Why? What is lock_kernel() protecting here?

Quoted 37 lines
 locks.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff -Nru a/fs/locks.c b/fs/locks.c

fs/locks.c +3 -6
@@ -1096,15 +1096,13 @@
 */
 void remove_lease(struct file_lock *fl)
 {
-	if (!IS_LEASE(fl))
-		return;
-
 	lock_kernel();
-
+	if (!fl || !IS_LEASE(fl))
+		goto out;
 	fl->fl_type = F_UNLCK | F_INPROGRESS;
 	fl->fl_break_time = jiffies - 10;
 	time_out_leases(fl->fl_file->f_dentry->d_inode);
-
+out:
 	unlock_kernel();
 }
 
-

To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain