summaryrefslogtreecommitdiff
path: root/fs/driverfs
diff options
context:
space:
mode:
authorRobert Love <rml@tech9.net>2002-02-05 18:46:45 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-02-05 18:46:45 -0800
commit3ffa0b66d4bef1a4e5fe5d71e2c5dd3e72093b7f (patch)
tree8fd249ec96b8475a2c30c0621106ecd82bf245ae /fs/driverfs
parenta0289e82ce4e460e7f9013993bdc5e69dd2fb1a6 (diff)
[PATCH] 2.5.4-pre1: further llseek cleanup (3/3)
The previous patch did not provide protection for device lseek methods (drivers/* stuff). This patch pushes the BKL into each of the remaining lseek methods -- without them we have a race. I'd much prefer to have a a better lock to push down than the BKL, but that will have to wait. Before you balk at the size, remember patch #2 in this series which removed much code ;-) Thanks to Al for assistance, especially a listing of affected files. Robert Love
Diffstat (limited to 'fs/driverfs')
-rw-r--r--fs/driverfs/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/driverfs/inode.c b/fs/driverfs/inode.c
index 802d5f8597f9..e5c6de322190 100644
--- a/fs/driverfs/inode.c
+++ b/fs/driverfs/inode.c
@@ -32,6 +32,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/device.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
@@ -341,6 +342,7 @@ driverfs_file_lseek(struct file *file, loff_t offset, int orig)
{
loff_t retval = -EINVAL;
+ lock_kernel();
switch(orig) {
case 0:
if (offset > 0) {
@@ -357,6 +359,7 @@ driverfs_file_lseek(struct file *file, loff_t offset, int orig)
default:
break;
}
+ unlock_kernel();
return retval;
}