Skip to contentSkip to conversation

mm-thp-fix-page_address_in_vma-on-file-thp-tails.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jun 27, 2021 Stable branch

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/thp: fix page_address_in_vma() on file THP tails
has been removed from the -mm tree. Its filename was
mm-thp-fix-page_address_in_vma-on-file-thp-tails.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Jue Wang <[email protected]>
Subject: mm/thp: fix page_address_in_vma() on file THP tails

Anon THP tails were already supported, but memory-failure may need to use page_address_in_vma() on file THP tails, which its page->mapping check did not permit: fix it.

hughd adds: no current usage is known to hit the issue, but this does fix a subtle trap in a general helper: best fixed in stable sooner than later.

Fixes 800d8c63b2e9 ("shmem: add huge pages support")
Cc Alistair Popple <[email protected]>
Cc Jan Kara <[email protected]>
Cc Miaohe Lin <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Peter Xu <[email protected]>
Cc Ralph Campbell <[email protected]>
Cc Shakeel Butt <[email protected]>
Cc Wang Yugui <[email protected]>
Cc Zi Yan <[email protected]>

---

 mm/rmap.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
mm/rmap.c renamed from mm/rmap.c~mm-thp-fix-page_address_in_vma-on-file-thp-tails +4 -4
@@ -716,11 +716,11 @@ unsigned long page_address_in_vma(struct
 		if (!vma->anon_vma || !page__anon_vma ||
 		    vma->anon_vma->root != page__anon_vma->root)
 			return -EFAULT;
-	} else if (page->mapping) {
-		if (!vma->vm_file || vma->vm_file->f_mapping != page->mapping)
-			return -EFAULT;
-	} else
+	} else if (!vma->vm_file) {
+		return -EFAULT;
+	} else if (vma->vm_file->f_mapping != compound_head(page)->mapping) {
 		return -EFAULT;
+	}
 
 	return vma_address(page, vma);
 }

_

Patches currently in -mm which might be from [email protected] are