task_nommu: fix compile failing bug because of spilt file.h
Subsystems (2)
PATCH 1/1 task_nommu: fix compile failing bug because of spilt file.h
CC fs/proc/task_nommu.ofs/proc/task_nommu.c: In function ‘task_mem’:fs/proc/task_nommu.c:55: error: dereferencing pointer to incomplete type make[2]: *** [fs/proc/task_nommu.o] Error 1
make[1]: *** [fs/proc] Error 2
make: *** [fs] Error 2
--- fs/proc/task_nommu.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/proc/task_nommu.c +1 -0
@@ -1,6 +1,7 @@#include <linux/mm.h> #include <linux/file.h> +#include <linux/fdtable.h> #include <linux/mount.h> #include <linux/ptrace.h> #include <linux/seq_file.h>
Signature · 1 line
1.5.5
fs/proc/task_nommu.c line 7
Quoted 12 lines · Bryan Wu
fs/proc/task_nommu.c +1
-0@@ -1,6 +1,7 @@#include <linux/mm.h> #include <linux/file.h> +#include <linux/fdtable.h> #include <linux/mount.h> #include <linux/ptrace.h> #include <linux/seq_file.h>
Well... I see what it's trying to do, but it's a bullshit. Look: it's from
if (current->files && atomic_read(¤t->files->count) > 1)
sbytes += kobjsize(current->files);
else
bytes += kobjsize(current->files);
Now, what we really have is size of current->files (fixed and not too large)
+ if descriptor table is too large to be embedded,
size of current->files->fdt
size of current->files->fdt->fd
size of current->files->fdt->open_fds/->close_on_execAnd the second term there can be *large*, so if we are really serious about taking descriptor table footprint into account, we'd better take care of that too. I'm not sure that we want to, though - note that we do that only on nommu targets...
So what's that code really trying to achieve?
Quoted 24 lines · Al Viro
fs/proc/task_nommu.c line 7
Quoted 12 lines · Bryan Wu
fs/proc/task_nommu.c +1
-0@@ -1,6 +1,7 @@#include <linux/mm.h> #include <linux/file.h> +#include <linux/fdtable.h> #include <linux/mount.h> #include <linux/ptrace.h> #include <linux/seq_file.h> Well... I see what it's trying to do, but it's a bullshit. Look: it's from
if (current->files && atomic_read(¤t->files->count) > 1) sbytes += kobjsize(current->files); else bytes += kobjsize(current->files); Now, what we really have is size of current->files (fixed and not too large) + if descriptor table is too large to be embedded, size of current->files->fdt size of current->files->fdt->fd size of current->files->fdt->open_fds/->close_on_exec
Quoted 7 lines
And the second term there can be *large*, so if we are really serious about taking descriptor table footprint into account, we'd better take care of that too. I'm not sure that we want to, though - note that we do that only on nommu targets...
So what's that code really trying to achieve?
Wow, my patch is just to kill the compile error, I did not notice this large size issue here.
I'd like to improve this code later.
Thanks
-Bryan
Quoted 3 lines · Bryan Wu
Wow, my patch is just to kill the compile error, I did not notice this large size issue here.
I'd like to improve this code later.
I certainly have no objections to the patch as is - the include is obviously missing.