hugetlb: remove meaningless BUG_ON(huge_pte_none())
authorMiaohe Lin <linmiaohe@huawei.com>
Thu, 1 Sep 2022 12:00:29 +0000 (20:00 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 Sep 2022 03:26:10 +0000 (20:26 -0700)
When code reaches here, invalid page would have been accessed if huge pte
is none. So this BUG_ON(huge_pte_none()) is meaningless. Remove it.

Link: https://lkml.kernel.org/r/20220901120030.63318-10-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb.c

index fe7b69a..4638720 100644 (file)
@@ -5345,7 +5345,6 @@ retry_avoidcopy:
                        u32 hash;
 
                        put_page(old_page);
-                       BUG_ON(huge_pte_none(pte));
                        /*
                         * Drop hugetlb_fault_mutex and i_mmap_rwsem before
                         * unmapping.  unmapping needs to hold i_mmap_rwsem