From 594ea7358b051d4638fb587e0234a8a038f47e3d Mon Sep 17 00:00:00 2001 From: liuhailong Date: Fri, 18 Jun 2021 17:50:35 +0800 Subject: [PATCH] staging: android: ashmem: add size field in procfs fdinfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add this information to help user to find ashmem problem. ashmem leak scenario: -000|fd = ashmem_create_region -001|mmap and pagefault -002|munmap -003|forget close(fd) <---- which lead to ashmem leak Signed-off-by: liuhailong 收件人: 刘海龙(DuckBuBee) Link: https://lore.kernel.org/r/20210618095035.32410-1-liuhailong@oppo.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/android/ashmem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index 8ee4320a5dc6..ddbde3f8430e 100644 --- a/drivers/staging/android/ashmem.c +++ b/drivers/staging/android/ashmem.c @@ -895,6 +895,8 @@ static void ashmem_show_fdinfo(struct seq_file *m, struct file *file) seq_printf(m, "name:\t%s\n", asma->name + ASHMEM_NAME_PREFIX_LEN); + seq_printf(m, "size:\t%zu\n", asma->size); + mutex_unlock(&ashmem_mutex); } #endif