summaryrefslogtreecommitdiffstats
path: root/mm/swap_slots.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2022-05-19 23:08:51 +0200
committerakpm <akpm@linux-foundation.org>2022-05-19 23:08:51 +0200
commitf19c25684c3e19b329e0498dd6d601df13c33223 (patch)
tree0c371bdf09f8f3aedddf55216d947e055cfe263a /mm/swap_slots.c
parentmm/swap: print bad swap offset entry in get_swap_device (diff)
downloadlinux-f19c25684c3e19b329e0498dd6d601df13c33223.tar.xz
linux-f19c25684c3e19b329e0498dd6d601df13c33223.zip
mm/swap: remove buggy cache->nr check in refill_swap_slots_cache
refill_swap_slots_cache is always called when cache->nr is 0. So remove such buggy and confusing check. Link: https://lkml.kernel.org/r/20220509131416.17553-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Acked-by: David Hildenbrand <david@redhat.com> Reviewed-by: Oscar Salvador <osalvador@suse.de> Cc: Alistair Popple <apopple@nvidia.com> Cc: David Howells <dhowells@redhat.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Naoya Horiguchi <naoya.horiguchi@nec.com> Cc: NeilBrown <neilb@suse.de> Cc: Peter Xu <peterx@redhat.com> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/swap_slots.c')
-rw-r--r--mm/swap_slots.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/swap_slots.c b/mm/swap_slots.c
index 2f877e6f87d7..2a65a89b5b4d 100644
--- a/mm/swap_slots.c
+++ b/mm/swap_slots.c
@@ -258,7 +258,7 @@ out_unlock:
/* called with swap slot cache's alloc lock held */
static int refill_swap_slots_cache(struct swap_slots_cache *cache)
{
- if (!use_swap_slot_cache || cache->nr)
+ if (!use_swap_slot_cache)
return 0;
cache->cur = 0;