Commit 34e284b6 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

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

Signed-off-by: default avatarAndy Adamson <andros@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 055c6053
...@@ -1096,15 +1096,13 @@ static void time_out_leases(struct inode *inode) ...@@ -1096,15 +1096,13 @@ static void time_out_leases(struct inode *inode)
*/ */
void remove_lease(struct file_lock *fl) void remove_lease(struct file_lock *fl)
{ {
if (!IS_LEASE(fl))
return;
lock_kernel(); lock_kernel();
if (!fl || !IS_LEASE(fl))
goto out;
fl->fl_type = F_UNLCK | F_INPROGRESS; fl->fl_type = F_UNLCK | F_INPROGRESS;
fl->fl_break_time = jiffies - 10; fl->fl_break_time = jiffies - 10;
time_out_leases(fl->fl_file->f_dentry->d_inode); time_out_leases(fl->fl_file->f_dentry->d_inode);
out:
unlock_kernel(); unlock_kernel();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment