diff options
author | Neil Brown <neilb@cse.unsw.edu.au> | 2005-01-04 05:48:59 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-04 05:48:59 -0800 |
commit | 34e284b6d07883b3f7e8db0824a5a3bf768128b2 (patch) | |
tree | 00d97ed0f9d03e591cc3f2c3c08e1467d707a325 /fs | |
parent | 055c60532108f1c4fd9950e8d304ae915cc7e34e (diff) | |
download | history-34e284b6d07883b3f7e8db0824a5a3bf768128b2.tar.gz |
[PATCH] knfsd: check for existence of file_lock parameter inside of the kernel lock.
Signed-off-by: Andy Adamson <andros@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/locks.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/locks.c b/fs/locks.c index 73993e478fb104..7538549a8c7064 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1096,15 +1096,13 @@ static void time_out_leases(struct inode *inode) */ 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(); } |