Messages in this thread Patch in this message | | | Date | Fri, 7 Jan 2005 04:21:17 +0000 | From | Matthew Wilcox <> | Subject | Re: [PATCH] knfsd: check for existence of file_lock parameter inside of the kernel lock. |
| |
On Wed, Jan 05, 2005 at 05:48:59AM +0000, Linux Kernel Mailing List wrote: > ChangeSet 1.2177, 2005/01/04 21:48:59-08:00, neilb@cse.unsw.edu.au > > [PATCH] knfsd: check for existence of file_lock parameter inside of the kernel lock.
Why? What is lock_kernel() protecting here?
> 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> > > > > locks.c | 8 +++----- > 1 files changed, 3 insertions(+), 5 deletions(-) > > > diff -Nru a/fs/locks.c b/fs/locks.c > --- a/fs/locks.c 2005-01-04 23:42:28 -08:00 > +++ b/fs/locks.c 2005-01-04 23:42:28 -08:00 > @@ -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 majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html
-- "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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |