aboutsummaryrefslogtreecommitdiff
path: root/arch/alpha
diff options
context:
space:
mode:
authorDipankar Sarma <dipankar@in.ibm.com>2005-09-16 19:28:13 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-17 11:50:02 -0700
commit4fb3a53860cee2aaaf81186c451b7da0b95b45c1 (patch)
treedb66ba7d3886644729707586aed781c445e12c16 /arch/alpha
parentaf4e5a218e18ad588d60a4f9d6f8fb5db1a32587 (diff)
[PATCH] files: fix preemption issues
With the new fdtable locking rules, you have to protect fdtable with either ->file_lock or rcu_read_lock/unlock(). There are some places where we aren't doing either. This patch fixes those places. Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/kernel/osf_sys.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 0636116210d..01fe990d3e5 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -37,6 +37,7 @@
#include <linux/namei.h>
#include <linux/uio.h>
#include <linux/vfs.h>
+#include <linux/rcupdate.h>
#include <asm/fpu.h>
#include <asm/io.h>
@@ -975,6 +976,7 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
long timeout;
int ret = -EINVAL;
struct fdtable *fdt;
+ int max_fdset;
timeout = MAX_SCHEDULE_TIMEOUT;
if (tvp) {
@@ -996,8 +998,11 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
}
}
+ rcu_read_lock();
fdt = files_fdtable(current->files);
- if (n < 0 || n > fdt->max_fdset)
+ max_fdset = fdt->max_fdset;
+ rcu_read_unlock();
+ if (n < 0 || n > max_fdset)
goto out_nofds;
/*