aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/array.c5
-rw-r--r--fs/proc/base.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 37668fe998ad..d88d518d30f6 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -159,6 +159,7 @@ static inline char * task_state(struct task_struct *p, char *buffer)
159{ 159{
160 struct group_info *group_info; 160 struct group_info *group_info;
161 int g; 161 int g;
162 struct fdtable *fdt = NULL;
162 163
163 read_lock(&tasklist_lock); 164 read_lock(&tasklist_lock);
164 buffer += sprintf(buffer, 165 buffer += sprintf(buffer,
@@ -179,10 +180,12 @@ static inline char * task_state(struct task_struct *p, char *buffer)
179 p->gid, p->egid, p->sgid, p->fsgid); 180 p->gid, p->egid, p->sgid, p->fsgid);
180 read_unlock(&tasklist_lock); 181 read_unlock(&tasklist_lock);
181 task_lock(p); 182 task_lock(p);
183 if (p->files)
184 fdt = files_fdtable(p->files);
182 buffer += sprintf(buffer, 185 buffer += sprintf(buffer,
183 "FDSize:\t%d\n" 186 "FDSize:\t%d\n"
184 "Groups:\t", 187 "Groups:\t",
185 p->files ? p->files->max_fds : 0); 188 fdt ? fdt->max_fds : 0);
186 189
187 group_info = p->group_info; 190 group_info = p->group_info;
188 get_group_info(group_info); 191 get_group_info(group_info);
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 84751f3f52d5..d0087a0b024b 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1039,6 +1039,7 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
1039 int retval; 1039 int retval;
1040 char buf[NUMBUF]; 1040 char buf[NUMBUF];
1041 struct files_struct * files; 1041 struct files_struct * files;
1042 struct fdtable *fdt;
1042 1043
1043 retval = -ENOENT; 1044 retval = -ENOENT;
1044 if (!pid_alive(p)) 1045 if (!pid_alive(p))
@@ -1062,8 +1063,9 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
1062 if (!files) 1063 if (!files)
1063 goto out; 1064 goto out;
1064 spin_lock(&files->file_lock); 1065 spin_lock(&files->file_lock);
1066 fdt = files_fdtable(files);
1065 for (fd = filp->f_pos-2; 1067 for (fd = filp->f_pos-2;
1066 fd < files->max_fds; 1068 fd < fdt->max_fds;
1067 fd++, filp->f_pos++) { 1069 fd++, filp->f_pos++) {
1068 unsigned int i,j; 1070 unsigned int i,j;
1069 1071