Re: [PATCH 4/6] USB-BKL: Remove BKL use in uhci-debug

From: Sergei Shtylyov
Date: Wed Jun 02 2010 - 06:12:52 EST


Hello.

Arnd Bergmann wrote:

From: Andi Kleen <ak@xxxxxxxxxxxxxxx>

BKL was not really needed, just came from earlier push downs.

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

Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>

[...]

diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c
index 98cf0b2..b0cf4f8 100644
--- a/drivers/usb/host/uhci-debug.c
+++ b/drivers/usb/host/uhci-debug.c

[...]

@@ -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;
}

Should have dropped {}...

- unlock_kernel();
return (file->f_pos = new);
}

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/