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 <mawupeng1@huawei.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Ma Wupeng 2023-06-27 20:08:32 +08:00 committed by Andrew Morton
parent 87b11f8622
commit 67490031e8

View File

@ -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);
}