mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 07:01:23 +00:00
[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:
parent
af4e5a218e
commit
4fb3a53860
5 changed files with 20 additions and 2 deletions
|
@ -74,6 +74,7 @@
|
|||
#include <linux/file.h>
|
||||
#include <linux/times.h>
|
||||
#include <linux/cpuset.h>
|
||||
#include <linux/rcupdate.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/pgtable.h>
|
||||
|
@ -180,12 +181,14 @@ static inline char * task_state(struct task_struct *p, char *buffer)
|
|||
p->gid, p->egid, p->sgid, p->fsgid);
|
||||
read_unlock(&tasklist_lock);
|
||||
task_lock(p);
|
||||
rcu_read_lock();
|
||||
if (p->files)
|
||||
fdt = files_fdtable(p->files);
|
||||
buffer += sprintf(buffer,
|
||||
"FDSize:\t%d\n"
|
||||
"Groups:\t",
|
||||
fdt ? fdt->max_fds : 0);
|
||||
rcu_read_unlock();
|
||||
|
||||
group_info = p->group_info;
|
||||
get_group_info(group_info);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue