diff mbox series

[09/10] hugetlb: remove meaningless BUG_ON(huge_pte_none())

Message ID 20220826092422.39591-10-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series A few cleanup patches for hugetlb | expand

Commit Message

Miaohe Lin Aug. 26, 2022, 9:24 a.m. UTC
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.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/hugetlb.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Muchun Song Aug. 27, 2022, 2:03 a.m. UTC | #1
> On Aug 26, 2022, at 17:24, Miaohe Lin <linmiaohe@huawei.com> wrote:
> 
> 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.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.
diff mbox series

Patch

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index b432a00061e3..0ef26dbdc7f8 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -5374,7 +5374,6 @@  static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma,
 			u32 hash;
 
 			put_page(old_page);
-			BUG_ON(huge_pte_none(pte));
 			/*
 			 * Drop hugetlb_fault_mutex and vma_lock before
 			 * unmapping.  unmapping needs to hold vma_lock