From 67490031e83a008c5ce8f562e7fa3b6b83adc861 Mon Sep 17 00:00:00 2001 From: Ma Wupeng Date: Tue, 27 Jun 2023 20:08:32 +0800 Subject: [PATCH] swap: cleanup duplicated WARN_ON in add_to_avail_list Patch series "fix WARN_ON in add_to_avail_list". Empty check for plist_node is checked in add_to_avail_list and plist_add. Drop the duplicate one in add_to_avail_list. Link: https://lkml.kernel.org/r/20230627120833.2230766-1-mawupeng1@huawei.com Link: https://lkml.kernel.org/r/20230627120833.2230766-2-mawupeng1@huawei.com Signed-off-by: Ma Wupeng Cc: Hugh Dickins Signed-off-by: Andrew Morton --- mm/swapfile.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index 8e6dde6..2a46936 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -714,10 +714,8 @@ static void add_to_avail_list(struct swap_info_struct *p) int nid; spin_lock(&swap_avail_lock); - for_each_node(nid) { - WARN_ON(!plist_node_empty(&p->avail_lists[nid])); + for_each_node(nid) plist_add(&p->avail_lists[nid], &swap_avail_heads[nid]); - } spin_unlock(&swap_avail_lock); } -- 2.7.4