[PATCH] filemap: fix the last_index of mm_filemap_get_pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In commit b6273b55d885 ("filemap: add trace events for get_pages,
map_pages, and fault"), mm_filemap_get_pages was added to trace page
cache access. However, it tracks an extra page beyond the end of the
accessed range. This patch fixes it by replacing last_index with
last_index - 1.

Fixes: b6273b55d885 ("filemap: add trace events for get_pages, map_pages, and fault")
Signed-off-by: Takaya Saeki <takayas@xxxxxxxxxxxx>
---
 mm/filemap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index fcfec2a78a30..d725d84b1947 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2548,7 +2548,7 @@ static int filemap_get_pages(struct kiocb *iocb, size_t count,
 			goto err;
 	}
 
-	trace_mm_filemap_get_pages(mapping, index, last_index);
+	trace_mm_filemap_get_pages(mapping, index, last_index - 1);
 	return 0;
 err:
 	if (err < 0)
-- 
2.46.0.469.g59c65b2a67-goog





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux