[PATCH 3/3] mm: mempolicy: check negative error of isolate_hugetlb() when failed to isolate a hugetlb

From: Baolin Wang
Date: Mon Feb 13 2023 - 22:18:39 EST


Better to check the negative error of isolate_hugetlb() when failed to
isolate a hugetlb page, which makes the code more clear.

No functional changes.

Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
---
mm/mempolicy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 0919c7a719d4..e3d87b21516b 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -609,7 +609,7 @@ static int queue_folios_hugetlb(pte_t *pte, unsigned long hmask,
if (flags & (MPOL_MF_MOVE_ALL) ||
(flags & MPOL_MF_MOVE && folio_estimated_sharers(folio) == 1 &&
!hugetlb_pmd_shared(pte))) {
- if (isolate_hugetlb(folio, qp->pagelist) &&
+ if (isolate_hugetlb(folio, qp->pagelist) < 0 &&
(flags & MPOL_MF_STRICT))
/*
* Failed to isolate folio but allow migrating pages
--
2.27.0