Skip to contentSkip to conversation

mm-memory-return-vm_fault_t-result-from-migrate_to_ram-callback.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Nov 23, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/memory: return vm_fault_t result from migrate_to_ram() callback
has been removed from the -mm tree. Its filename was
mm-memory-return-vm_fault_t-result-from-migrate_to_ram-callback.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Alistair Popple <[email protected]>
Subject: mm/memory: return vm_fault_t result from migrate_to_ram() callback
Date: Mon, 14 Nov 2022 22:55:37 +1100

The migrate_to_ram() callback should always succeed, but in rare cases can fail usually returning VM_FAULT_SIGBUS. Commit 16ce101db85d ("mm/memory.c: fix race when faulting a device private page") incorrectly stopped passing the return code up the stack. Fix this by setting the ret variable, restoring the previous behaviour on migrate_to_ram() failure.

Fixes 16ce101db85d ("mm/memory.c: fix race when faulting a device private page")
Cc Ralph Campbell <[email protected]>
Cc John Hubbard <[email protected]>
Cc Alex Sierra <[email protected]>
Cc Ben Skeggs <[email protected]>
Cc Lyude Paul <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Michael Ellerman <[email protected]>

---

 mm/memory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory.c renamed from mm/memory.c~mm-memory-return-vm_fault_t-result-from-migrate_to_ram-callback +1 -1
@@ -3763,7 +3763,7 @@ vm_fault_t do_swap_page(struct vm_fault
 			 */
 			get_page(vmf->page);
 			pte_unmap_unlock(vmf->pte, vmf->ptl);
-			vmf->page->pgmap->ops->migrate_to_ram(vmf);
+			ret = vmf->page->pgmap->ops->migrate_to_ram(vmf);
 			put_page(vmf->page);
 		} else if (is_hwpoison_entry(entry)) {
 			ret = VM_FAULT_HWPOISON;

_

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