All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] [vfs/proc] task_nommu: fix compile failing bug because of spilt file.h
@ 2008-05-04 15:12 Bryan Wu
  2008-05-04 15:30 ` Al Viro
  0 siblings, 1 reply; 4+ messages in thread
From: Bryan Wu @ 2008-05-04 15:12 UTC (permalink / raw)
  To: viro, torvalds, akpm, linux-kernel; +Cc: Bryan Wu

  CC      fs/proc/task_nommu.o
fs/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

Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 fs/proc/task_nommu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
index 6cba820..987bc69 100644
--- a/fs/proc/task_nommu.c
+++ b/fs/proc/task_nommu.c
@@ -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>
-- 
1.5.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] [vfs/proc] task_nommu: fix compile failing bug because of spilt file.h
  2008-05-04 15:12 [PATCH 1/1] [vfs/proc] task_nommu: fix compile failing bug because of spilt file.h Bryan Wu
@ 2008-05-04 15:30 ` Al Viro
  2008-05-04 17:25   ` Bryan Wu
  0 siblings, 1 reply; 4+ messages in thread
From: Al Viro @ 2008-05-04 15:30 UTC (permalink / raw)
  To: Bryan Wu; +Cc: torvalds, akpm, linux-kernel

On Sun, May 04, 2008 at 11:12:55PM +0800, Bryan Wu wrote:
> diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
> index 6cba820..987bc69 100644
> --- a/fs/proc/task_nommu.c
> +++ b/fs/proc/task_nommu.c
> @@ -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(&current->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
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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] [vfs/proc] task_nommu: fix compile failing bug because of spilt file.h
  2008-05-04 15:30 ` Al Viro
@ 2008-05-04 17:25   ` Bryan Wu
  2008-05-04 17:33     ` Al Viro
  0 siblings, 1 reply; 4+ messages in thread
From: Bryan Wu @ 2008-05-04 17:25 UTC (permalink / raw)
  To: Al Viro; +Cc: torvalds, akpm, linux-kernel

On Sun, May 4, 2008 at 11:30 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Sun, May 04, 2008 at 11:12:55PM +0800, Bryan Wu wrote:
>  > diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
>  > index 6cba820..987bc69 100644
>  > --- a/fs/proc/task_nommu.c
>  > +++ b/fs/proc/task_nommu.c
>  > @@ -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(&current->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
>  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] [vfs/proc] task_nommu: fix compile failing bug because of spilt file.h
  2008-05-04 17:25   ` Bryan Wu
@ 2008-05-04 17:33     ` Al Viro
  0 siblings, 0 replies; 4+ messages in thread
From: Al Viro @ 2008-05-04 17:33 UTC (permalink / raw)
  To: Bryan Wu; +Cc: torvalds, akpm, linux-kernel

On Mon, May 05, 2008 at 01:25:37AM +0800, Bryan Wu wrote:

> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-04 17:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-04 15:12 [PATCH 1/1] [vfs/proc] task_nommu: fix compile failing bug because of spilt file.h Bryan Wu
2008-05-04 15:30 ` Al Viro
2008-05-04 17:25   ` Bryan Wu
2008-05-04 17:33     ` Al Viro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.