lkml.org 
[lkml]   [2010]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/6] USB-BKL: Remove BKL use in uhci-debug
On Tue, 1 Jun 2010, Arnd Bergmann wrote:

> From: Andi Kleen <ak@linux.intel.com>
>
> BKL was not really needed, just came from earlier push downs.

Yes.

> The only part that's a bit dodgy is the lseek function. Would
> need another lock or atomic access to fpos on 32bit?
> Better to have a libfs lseek

It doesn't matter. Anyone who tries to do lseeks on this file
from two different threads, simultaneously, deserves what they get.

> @@ -539,11 +534,11 @@ static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence)
> new = file->f_pos + off;
> break;
> }
> +
> + /* XXX: Can size shrink? */
> if (new < 0 || new > up->size) {
> - unlock_kernel();
> return -EINVAL;
> }
> - unlock_kernel();
> return (file->f_pos = new);
> }

This comment isn't needed; the size cannot change after the file has
been opened.

Alan Stern



\
 
 \ /
  Last update: 2010-06-02 15:51    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site