All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] procfs: fix tid fdinfo
@ 2010-04-23 15:40 Jerome Marchand
  2010-04-23 18:16 ` Andrew Morton
  2010-04-24 16:28 ` Alexey Dobriyan
  0 siblings, 2 replies; 7+ messages in thread
From: Jerome Marchand @ 2010-04-23 15:40 UTC (permalink / raw)
  To: Alexander Viro; +Cc: Miklos Szeredi, Linux Kernel Mailing List

Correct the file_operations struct in fdinfo entry of tid_base_stuff[].

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
---
 base.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 7621db8..8418fcc 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2909,7 +2909,7 @@ out_no_task:
  */
 static const struct pid_entry tid_base_stuff[] = {
 	DIR("fd",        S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations),
-	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fd_operations),
+	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
 	REG("environ",   S_IRUSR, proc_environ_operations),
 	INF("auxv",      S_IRUSR, proc_pid_auxv),
 	ONE("status",    S_IRUGO, proc_pid_status),

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

* Re: [PATCH] procfs: fix tid fdinfo
  2010-04-23 15:40 [PATCH] procfs: fix tid fdinfo Jerome Marchand
@ 2010-04-23 18:16 ` Andrew Morton
  2010-04-24 19:27   ` Alexey Dobriyan
  2010-04-24 16:28 ` Alexey Dobriyan
  1 sibling, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2010-04-23 18:16 UTC (permalink / raw)
  To: Jerome Marchand
  Cc: Alexander Viro, Miklos Szeredi, Linux Kernel Mailing List,
	Alexey Dobriyan

On Fri, 23 Apr 2010 17:40:07 +0200
Jerome Marchand <jmarchan@redhat.com> wrote:

> Correct the file_operations struct in fdinfo entry of tid_base_stuff[].
> 
> Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
> ---
>  base.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 7621db8..8418fcc 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -2909,7 +2909,7 @@ out_no_task:
>   */
>  static const struct pid_entry tid_base_stuff[] = {
>  	DIR("fd",        S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations),
> -	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fd_operations),
> +	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
>  	REG("environ",   S_IRUSR, proc_environ_operations),
>  	INF("auxv",      S_IRUSR, proc_pid_auxv),
>  	ONE("status",    S_IRUGO, proc_pid_status),

hm, the code's been like that for over a year.  What are the
user-visible effects of the bug, and of this change?

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

* Re: [PATCH] procfs: fix tid fdinfo
  2010-04-24 19:27   ` Alexey Dobriyan
@ 2010-04-23 20:07     ` Miklos Szeredi
  2010-04-26  7:49       ` Jerome Marchand
  0 siblings, 1 reply; 7+ messages in thread
From: Miklos Szeredi @ 2010-04-23 20:07 UTC (permalink / raw)
  To: Alexey Dobriyan
  Cc: Andrew Morton, Jerome Marchand, Alexander Viro,
	Linux Kernel Mailing List

On Sat, 2010-04-24 at 22:27 +0300, Alexey Dobriyan wrote:
> On Fri, Apr 23, 2010 at 11:16:20AM -0700, Andrew Morton wrote:
> > On Fri, 23 Apr 2010 17:40:07 +0200
> > > -	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fd_operations),
> > > +	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
> 
> > hm, the code's been like that for over a year.  What are the
> > user-visible effects of the bug, and of this change?
> 
> /proc/*/task/*/fdinfo contains symlinks to opened files like /proc/*/fd/
> which is cool bug :-)

Yeah, at least now we can see that someone has started using this
interface ;)

Jerome, thanks for spotting this!

Miklos



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

* Re: [PATCH] procfs: fix tid fdinfo
  2010-04-23 15:40 [PATCH] procfs: fix tid fdinfo Jerome Marchand
  2010-04-23 18:16 ` Andrew Morton
@ 2010-04-24 16:28 ` Alexey Dobriyan
  1 sibling, 0 replies; 7+ messages in thread
From: Alexey Dobriyan @ 2010-04-24 16:28 UTC (permalink / raw)
  To: Jerome Marchand; +Cc: Alexander Viro, Miklos Szeredi, Linux Kernel Mailing List

On Fri, Apr 23, 2010 at 05:40:07PM +0200, Jerome Marchand wrote:
> -	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fd_operations),
> +	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),

Ick.

this is for stable@ as well

Cc: stable@kernel.org

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

* Re: [PATCH] procfs: fix tid fdinfo
  2010-04-23 18:16 ` Andrew Morton
@ 2010-04-24 19:27   ` Alexey Dobriyan
  2010-04-23 20:07     ` Miklos Szeredi
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Dobriyan @ 2010-04-24 19:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Jerome Marchand, Alexander Viro, Miklos Szeredi,
	Linux Kernel Mailing List

On Fri, Apr 23, 2010 at 11:16:20AM -0700, Andrew Morton wrote:
> On Fri, 23 Apr 2010 17:40:07 +0200
> > -	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fd_operations),
> > +	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),

> hm, the code's been like that for over a year.  What are the
> user-visible effects of the bug, and of this change?

/proc/*/task/*/fdinfo contains symlinks to opened files like /proc/*/fd/
which is cool bug :-)

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

* Re: [PATCH] procfs: fix tid fdinfo
  2010-04-23 20:07     ` Miklos Szeredi
@ 2010-04-26  7:49       ` Jerome Marchand
  2010-04-26 10:26         ` Miklos Szeredi
  0 siblings, 1 reply; 7+ messages in thread
From: Jerome Marchand @ 2010-04-26  7:49 UTC (permalink / raw)
  To: Miklos Szeredi
  Cc: Alexey Dobriyan, Andrew Morton, Alexander Viro,
	Linux Kernel Mailing List, Vic Abell

On 04/23/2010 10:07 PM, Miklos Szeredi wrote:
> On Sat, 2010-04-24 at 22:27 +0300, Alexey Dobriyan wrote:
>> On Fri, Apr 23, 2010 at 11:16:20AM -0700, Andrew Morton wrote:
>>> On Fri, 23 Apr 2010 17:40:07 +0200
>>>> -	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fd_operations),
>>>> +	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
>>
>>> hm, the code's been like that for over a year.  What are the
>>> user-visible effects of the bug, and of this change?
>>
>> /proc/*/task/*/fdinfo contains symlinks to opened files like /proc/*/fd/
>> which is cool bug :-)
> 
> Yeah, at least now we can see that someone has started using this
> interface ;)

AFAIK there is still nobody using it, but lsof should use it, and 
/proc/<pid>/task/<tid>/fd/ too. I haven't checked the code, but as it is
now, it doesn't spot files open by a thread which does share its father's
file descriptor table.

> 
> Jerome, thanks for spotting this!
> 
> Miklos
> 
> 


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

* Re: [PATCH] procfs: fix tid fdinfo
  2010-04-26  7:49       ` Jerome Marchand
@ 2010-04-26 10:26         ` Miklos Szeredi
  0 siblings, 0 replies; 7+ messages in thread
From: Miklos Szeredi @ 2010-04-26 10:26 UTC (permalink / raw)
  To: Jerome Marchand
  Cc: Alexey Dobriyan, Andrew Morton, Alexander Viro,
	Linux Kernel Mailing List, Vic Abell

On Mon, 2010-04-26 at 09:49 +0200, Jerome Marchand wrote:
> On 04/23/2010 10:07 PM, Miklos Szeredi wrote:
> > On Sat, 2010-04-24 at 22:27 +0300, Alexey Dobriyan wrote:
> >> On Fri, Apr 23, 2010 at 11:16:20AM -0700, Andrew Morton wrote:
> >>> On Fri, 23 Apr 2010 17:40:07 +0200
> >>>> -	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fd_operations),
> >>>> +	DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
> >>
> >>> hm, the code's been like that for over a year.  What are the
> >>> user-visible effects of the bug, and of this change?
> >>
> >> /proc/*/task/*/fdinfo contains symlinks to opened files like /proc/*/fd/
> >> which is cool bug :-)
> > 
> > Yeah, at least now we can see that someone has started using this
> > interface ;)
> 
> AFAIK there is still nobody using it, but lsof should use it, and 
> /proc/<pid>/task/<tid>/fd/ too. I haven't checked the code, but as it is
> now, it doesn't spot files open by a thread which does share its father's
> file descriptor table.

Yes, apparently "lsof" doesn't care about contents of /proc/$PID/task.
Well, tasks with separate file descriptor tables are rare, POSIX threads
share their descriptor tables.  But it would be nice if this were fixed.

Thanks,
Miklos



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

end of thread, other threads:[~2010-04-26 10:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-23 15:40 [PATCH] procfs: fix tid fdinfo Jerome Marchand
2010-04-23 18:16 ` Andrew Morton
2010-04-24 19:27   ` Alexey Dobriyan
2010-04-23 20:07     ` Miklos Szeredi
2010-04-26  7:49       ` Jerome Marchand
2010-04-26 10:26         ` Miklos Szeredi
2010-04-24 16:28 ` Alexey Dobriyan

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.