linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.24-rc4-mm1 and /proc/<pid>/status Name: field
@ 2007-12-07 20:26 Zan Lynx
  2007-12-07 23:58 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Zan Lynx @ 2007-12-07 20:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]

Today I noticed pgrep doesn't work.  It seems the reason is a missing
Name: tag in the status file for a process in /proc.

# cat /proc/1/status
init
State:  S (sleeping)
Tgid:   1
Pid:    1
PPid:   0
TracerPid:      0
...etc, etc...

This is supposed to look like:
# cat /proc/1/status
Name:	init
State:	S (sleeping)
Tgid:	1
Pid:	1
PPid:	0
TracerPid:	0
...


-- 
Zan Lynx <zlynx@acm.org>

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: 2.6.24-rc4-mm1 and /proc/<pid>/status Name: field
  2007-12-07 20:26 2.6.24-rc4-mm1 and /proc/<pid>/status Name: field Zan Lynx
@ 2007-12-07 23:58 ` Andrew Morton
  2007-12-08  3:59   ` Eric W. Biederman
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-12-07 23:58 UTC (permalink / raw)
  To: Zan Lynx; +Cc: linux-kernel, Eric W. Biederman

On Fri, 07 Dec 2007 20:26:43 +0000
Zan Lynx <zlynx@acm.org> wrote:

> Today I noticed pgrep doesn't work.  It seems the reason is a missing
> Name: tag in the status file for a process in /proc.
> 
> # cat /proc/1/status
> init
> State:  S (sleeping)
> Tgid:   1
> Pid:    1
> PPid:   0
> TracerPid:      0
> ...etc, etc...
> 
> This is supposed to look like:
> # cat /proc/1/status
> Name:	init
> State:	S (sleeping)
> Tgid:	1
> Pid:	1
> PPid:	0
> TracerPid:	0
> ...
> 

Thanks.  Two (more) bugs in
proc-seqfile-convert-proc_pid_status-to-properly-handle-pid-namespaces.patch

--- a/fs/proc/array.c~proc-seqfile-convert-proc_pid_status-to-properly-handle-pid-namespaces-fix-3
+++ a/fs/proc/array.c
@@ -98,9 +98,9 @@ static inline void task_name(struct seq_
 
 	get_task_comm(tcomm, p);
 
+	seq_printf(m, "Name:\t");
 	end = m->buf + m->size;
 	buf = m->buf + m->count;
-	seq_printf(m, "Name:\n");
 	name = tcomm;
 	i = sizeof(tcomm);
 	while (i && (buf < end)) {
_


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

* Re: 2.6.24-rc4-mm1 and /proc/<pid>/status Name: field
  2007-12-07 23:58 ` Andrew Morton
@ 2007-12-08  3:59   ` Eric W. Biederman
  0 siblings, 0 replies; 3+ messages in thread
From: Eric W. Biederman @ 2007-12-08  3:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Zan Lynx, linux-kernel

Andrew Morton <akpm@linux-foundation.org> writes:

> On Fri, 07 Dec 2007 20:26:43 +0000
> Zan Lynx <zlynx@acm.org> wrote:
>
>> Today I noticed pgrep doesn't work.  It seems the reason is a missing
>> Name: tag in the status file for a process in /proc.
>> 
>> # cat /proc/1/status
>> init
>> State:  S (sleeping)
>> Tgid:   1
>> Pid:    1
>> PPid:   0
>> TracerPid:      0
>> ...etc, etc...
>> 
>> This is supposed to look like:
>> # cat /proc/1/status
>> Name:	init
>> State:	S (sleeping)
>> Tgid:	1
>> Pid:	1
>> PPid:	0
>> TracerPid:	0
>> ...
>> 
>
> Thanks.  Two (more) bugs in
> proc-seqfile-convert-proc_pid_status-to-properly-handle-pid-namespaces.patch

Doh!  How did I get that one confused?

Thanks.
Eric


>
> ---
> a/fs/proc/array.c~proc-seqfile-convert-proc_pid_status-to-properly-handle-pid-namespaces-fix-3
> +++ a/fs/proc/array.c
> @@ -98,9 +98,9 @@ static inline void task_name(struct seq_
>  
>  	get_task_comm(tcomm, p);
>  
> +	seq_printf(m, "Name:\t");
>  	end = m->buf + m->size;
>  	buf = m->buf + m->count;
> -	seq_printf(m, "Name:\n");
>  	name = tcomm;
>  	i = sizeof(tcomm);
>  	while (i && (buf < end)) {
> _

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

end of thread, other threads:[~2007-12-08  4:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-07 20:26 2.6.24-rc4-mm1 and /proc/<pid>/status Name: field Zan Lynx
2007-12-07 23:58 ` Andrew Morton
2007-12-08  3:59   ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).