* last fs/proc/array.c change
@ 2012-03-24 12:26 Ulrich Drepper
2012-03-26 0:53 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Drepper @ 2012-03-24 12:26 UTC (permalink / raw)
To: Linux Kernel Mailing List, KAMEZAWA Hiroyuki
Not sure whether this has already been reported, at least I haven't
seen it. A recent patch to fs/proc/array.c contained this:
- seq_printf(m, "%lu %lu %lu %lu 0 %lu 0\n",
- size, resident, shared, text, data);
+ /*
+ * For quick read, open code by putting numbers directly
+ * expected format is
+ * seq_printf(m, "%lu %lu %lu %lu 0 %lu 0\n",
+ * size, resident, shared, text, data);
+ */
+ seq_put_decimal_ull(m, 0, size);
+ seq_put_decimal_ull(m, ' ', resident);
+ seq_put_decimal_ull(m, ' ', shared);
+ seq_put_decimal_ull(m, ' ', text);
+ seq_put_decimal_ull(m, ' ', 0);
+ seq_put_decimal_ull(m, ' ', text);
+ seq_put_decimal_ull(m, ' ', 0);
+ seq_putc(m, '\n');
See the second to last seq_put_decimal_ull. This is a copy&paste
mistake since given the original format it should read
+ seq_put_decimal_ull(m, ' ', data);
(i.e., data instead of text).
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: last fs/proc/array.c change
2012-03-24 12:26 last fs/proc/array.c change Ulrich Drepper
@ 2012-03-26 0:53 ` KAMEZAWA Hiroyuki
0 siblings, 0 replies; 2+ messages in thread
From: KAMEZAWA Hiroyuki @ 2012-03-26 0:53 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Linux Kernel Mailing List, Andrew Morton
(2012/03/24 21:26), Ulrich Drepper wrote:
> See the second to last seq_put_decimal_ull. This is a copy&paste
> mistake since given the original format it should read
>
> + seq_put_decimal_ull(m, ' ', data);
>
> (i.e., data instead of text).
Thank you for finding..
==
Subject: [PATCH] proc: fix /proc/statm
The patch 'procfs: speed up /proc/pid/stat, statm' breaks /proc/statm
and 'text' is printed twice by mistake.
Reported-by: drepper@gmail.com
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
fs/proc/array.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/proc/array.c b/fs/proc/array.c
index fbb53c2..f9bd395 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -550,7 +550,7 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
seq_put_decimal_ull(m, ' ', shared);
seq_put_decimal_ull(m, ' ', text);
seq_put_decimal_ull(m, ' ', 0);
- seq_put_decimal_ull(m, ' ', text);
+ seq_put_decimal_ull(m, ' ', data);
seq_put_decimal_ull(m, ' ', 0);
seq_putc(m, '\n');
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-26 0:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-24 12:26 last fs/proc/array.c change Ulrich Drepper
2012-03-26 0:53 ` KAMEZAWA Hiroyuki
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.