lkml.org 
[lkml]   [2010]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2] [RFC] Remove BKL from fs/locks.c
Date
On Thursday 15 April 2010, Steven Whitehouse wrote:

> Some comments...

I'll wait for Willy to comment on most of these, except

> On Wed, 2010-04-14 at 22:36 +0200, Arnd Bergmann wrote:
> > @@ -1467,12 +1492,9 @@ int vfs_setlease(struct file *filp, long arg, struct file_lock **lease)
> > {
> > int error;
> >
> > - lock_kernel();
> > - if (filp->f_op && filp->f_op->setlease)
> > - error = filp->f_op->setlease(filp, arg, lease);
> > - else
> > - error = generic_setlease(filp, arg, lease);
> > - unlock_kernel();
> > + lock_flocks();
> > + error = __vfs_setlease(filp, arg, lease);
> > + unlock_flocks();
> >
> This looks to me like generic_setlease() or whatever fs specific
> ->setlease() there might be will be called under a spin lock. That
> doesn't look right to me.
>
> Rather than adding locking here, why not push the BKL down into
> generic_setlease() and ->setlease() first, and then eliminate it on a
> case by case basis later on? That is the pattern that has been followed
> elsewhere in the kernel.

Sounds fair. Besides generic_setlease (which is in this file as well),
the only non-trivial one is cifs_setlease (Cc'ing Steve French now)
and that calls generic_setlease in the end.

If we can show that cifs_setlease does not need locking, the new lock
could be put into generic_setlease directly.

Arnd


\
 
 \ /
  Last update: 2010-04-15 17:21    [W:0.053 / U:7.568 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site