]> git.baikalelectronics.ru Git - kernel.git/commit
mm/memory: return vm_fault_t result from migrate_to_ram() callback
authorAlistair Popple <apopple@nvidia.com>
Mon, 14 Nov 2022 11:55:37 +0000 (22:55 +1100)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 23 Nov 2022 02:50:42 +0000 (18:50 -0800)
commit855363f19d50ff13f17e42995407937a5dab977a
tree1fead60bdfe8c4113d1769bc5c5e6f454c450900
parent70ef6f137d8028b6e80f9c71c2de7357516cf0fd
mm/memory: return vm_fault_t result from migrate_to_ram() callback

The migrate_to_ram() callback should always succeed, but in rare cases can
fail usually returning VM_FAULT_SIGBUS.  Commit 0d9d166cc4b1
("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.

Link: https://lkml.kernel.org/r/20221114115537.727371-1-apopple@nvidia.com
Fixes: 0d9d166cc4b1 ("mm/memory.c: fix race when faulting a device private page")
Signed-off-by: Alistair Popple <apopple@nvidia.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Alex Sierra <alex.sierra@amd.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory.c