Skip to contentSkip to conversation

arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags

PATCH New Huang Shijie 2 participants 2 messages Jan 11, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags

In current code, the @changed always returns the last one's status for the huge page with the contiguous bit set. This is really not what we want. Even one of the PTEs is changed, we should tell it to the caller.

This patch fixes this issue.

Fixes 66b3923a1a0f ("arm64: hugetlb: add support for PTE contiguous bit")
Cc stable at vger.kernel.org
---
 arch/arm64/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/hugetlbpage.c +1 -1
index 964b7549af5c..e25584d72396 100644
@@ -239,7 +239,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
 		ncontig = find_num_contig(vma->vm_mm, addr, cpte,
 					  *cpte, &pgsize);
 		for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) {
-			changed = ptep_set_access_flags(vma, addr, cpte,
+			changed |= ptep_set_access_flags(vma, addr, cpte,
 							pfn_pte(pfn,
 								hugeprot),
 							dirty);
Signature · 1 line
2.5.5
maintainer
#1 lore raw

PATCH v2 1/1 arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags

Quoted 10 lines · Huang Shijie

In current code, the @changed always returns the last one's status for the huge page with the contiguous bit set. This is really not what we want. Even one of the PTEs is changed, we should tell it to the caller.

This patch fixes this issue.

Fixes 66b3923a1a0f ("arm64: hugetlb: add support for PTE contiguous bit")
Cc stable at vger.kernel.org

Applied for 4.10. Thanks.

Signature · 1 line
Catalin