Commit 69d01234 authored by Huang Shijie's avatar Huang Shijie Committed by Catalin Marinas

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: 66b3923a ("arm64: hugetlb: add support for PTE contiguous bit")
Cc: <stable@vger.kernel.org> # 4.5.x-
Signed-off-by: default avatarHuang Shijie <shijie.huang@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent a121103c
...@@ -239,7 +239,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma, ...@@ -239,7 +239,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
ncontig = find_num_contig(vma->vm_mm, addr, cpte, ncontig = find_num_contig(vma->vm_mm, addr, cpte,
*cpte, &pgsize); *cpte, &pgsize);
for (i = 0; i < ncontig; ++i, ++cpte, addr += 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, pfn_pte(pfn,
hugeprot), hugeprot),
dirty); dirty);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment