Hugh Dickins 95feeabb77 mm/khugepaged: fix the xas_create_range() error path
collapse_shmem()'s xas_nomem() is very unlikely to fail, but it is
rightly given a failure path, so move the whole xas_create_range() block
up before __SetPageLocked(new_page): so that it does not need to
remember to unlock_page(new_page).

Add the missing mem_cgroup_cancel_charge(), and set (currently unused)
result to SCAN_FAIL rather than SCAN_SUCCEED.

Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1811261531200.2275@eggly.anvils
Fixes: 77da9389b9d5 ("mm: Convert collapse_shmem to XArray")
Signed-off-by: Hugh Dickins <hughd@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-11-30 14:56:15 -08:00
..
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:15 -07:00
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:17 -07:00
2018-09-29 22:47:49 -04:00
2018-06-07 17:34:36 -07:00
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:16 -07:00
2018-11-02 11:25:48 -07:00
2018-11-01 14:42:49 -07:00
2018-10-26 16:26:33 -07:00
2018-10-26 16:26:33 -07:00
2018-11-18 10:15:09 -08:00
2018-02-06 18:32:48 -08:00