[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>
This commit is contained in:
Dipankar Sarma 2005-09-16 19:28:13 -07:00 committed by Linus Torvalds
parent af4e5a218e
commit 4fb3a53860
5 changed files with 20 additions and 2 deletions

View file

@ -124,6 +124,7 @@
#include <linux/smp_lock.h>
#include <linux/syscalls.h>
#include <linux/time.h>
#include <linux/rcupdate.h>
#include <asm/semaphore.h>
#include <asm/uaccess.h>
@ -2205,6 +2206,7 @@ void steal_locks(fl_owner_t from)
lock_kernel();
j = 0;
rcu_read_lock();
fdt = files_fdtable(files);
for (;;) {
unsigned long set;
@ -2222,6 +2224,7 @@ void steal_locks(fl_owner_t from)
set >>= 1;
}
}
rcu_read_unlock();
unlock_kernel();
}
EXPORT_SYMBOL(steal_locks);