summaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2011-01-12 17:00:32 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 08:03:16 -0800
commita2ade7b6ca37c808128810687cd56e8a44443e65 (patch)
treed7ffb1be14e69f4ba22ca425c21369d4dd3a3032 /fs/proc/array.c
parent34e49d4f635d6a800c4089c40fd254e12e451449 (diff)
downloadop-kernel-dev-a2ade7b6ca37c808128810687cd56e8a44443e65.zip
op-kernel-dev-a2ade7b6ca37c808128810687cd56e8a44443e65.tar.gz
proc: use unsigned long inside /proc/*/statm
/proc/*/statm code needlessly truncates data from unsigned long to int. One needs only 8+ TB of RAM to make truncation visible. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index fff6572..842a656 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -535,15 +535,15 @@ int proc_tgid_stat(struct seq_file *m, struct pid_namespace *ns,
int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *task)
{
- int size = 0, resident = 0, shared = 0, text = 0, lib = 0, data = 0;
+ unsigned long size = 0, resident = 0, shared = 0, text = 0, data = 0;
struct mm_struct *mm = get_task_mm(task);
if (mm) {
size = task_statm(mm, &shared, &text, &data, &resident);
mmput(mm);
}
- seq_printf(m, "%d %d %d %d %d %d %d\n",
- size, resident, shared, text, lib, data, 0);
+ seq_printf(m, "%lu %lu %lu %lu 0 %lu 0\n",
+ size, resident, shared, text, data);
return 0;
}
OpenPOWER on IntegriCloud