]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fs: drop_caches: fix skipping over shadow cache inodes
authorJohannes Weiner <hannes@cmpxchg.org>
Mon, 23 Aug 2021 23:59:07 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:33:40 +0000 (09:33 +1000)
commit2e0fb5261bcfc236de8d828512d7d4c04fa89779
tree2e8b04a3fe301925c9449ff46e769fff80ad065f
parentb54b9a0d3771e2d9ad3c5aae33957a4a3ef480d8
fs: drop_caches: fix skipping over shadow cache inodes

When drop_caches truncates the page cache in an inode it also includes any
shadow entries for evicted pages.  However, there is a preliminary check
on whether the inode has pages: if it has *only* shadow entries, it will
skip running truncation on the inode and leave it behind.

Fix the check to mapping_empty(), such that it runs truncation on any
inode that has cache entries at all.

Link: https://lkml.kernel.org/r/20210614211904.14420-2-hannes@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reported-by: Roman Gushchin <guro@fb.com>
Acked-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
fs/drop_caches.c