[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220413211357.26938-1-alex_y_xu@yahoo.ca>
Date: Wed, 13 Apr 2022 17:13:57 -0400
From: "Alex Xu (Hello71)" <alex_y_xu@...oo.ca>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Vlastimil Babka <vbabka@...e.cz>,
Daniel Colascione <dancol@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Alexey Dobriyan <adobriyan@...il.com>,
linux-api@...r.kernel.org, "Alex Xu (Hello71)" <alex_y_xu@...oo.ca>
Subject: [PATCH] mm/smaps_rollup: return empty file for kthreads instead of ESRCH
This restores the behavior prior to 258f669e7e88 ("mm:
/proc/pid/smaps_rollup: convert to single value seq_file"), making it
once again consistent with maps and smaps, and allowing patterns like
awk '$1=="Anonymous:"{x+=$2}END{print x}' /proc/*/smaps_rollup to work.
Searching all Debian packages for "smaps_rollup" did not find any
programs which would be affected by this change.
Fixes: 258f669e7e88 ("mm: /proc/pid/smaps_rollup: convert to single value seq_file")
Signed-off-by: Alex Xu (Hello71) <alex_y_xu@...oo.ca>
---
fs/proc/task_mmu.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index f46060eb91b5..d7de4584a271 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -883,10 +883,8 @@ static int show_smaps_rollup(struct seq_file *m, void *v)
return -ESRCH;
mm = priv->mm;
- if (!mm || !mmget_not_zero(mm)) {
- ret = -ESRCH;
+ if (!mm || !mmget_not_zero(mm))
goto out_put_task;
- }
memset(&mss, 0, sizeof(mss));
--
2.35.2
Powered by blists - more mailing lists