Linux/linux 8703954mm shmem.c

mm: swapoff: shmem_find_swap_entries() filter out other types

Swapfile "type" was passed all the way down to shmem_unuse_inode(), but
then forgotten from shmem_find_swap_entries(): with the result that
removing one swapfile would try to free up all the swap from shmem - no
problem when only one swapfile anyway, but counter-productive when more,
causing swapoff to be unnecessarily OOM-killed when it should succeed.

Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1904081254470.1523@eggly.anvils
Fixes: b56a2d8af914 ("mm: rid swapoff of quadratic complexity")
Signed-off-by: Hugh Dickins <hughd at google.com>
Cc: Konstantin Khlebnikov <khlebnikov at yandex-team.ru>
Cc: "Alex Xu (Hello71)" <alex_y_xu at yahoo.ca>
Cc: Vineeth Pillai <vpillai at digitalocean.com>
Cc: Kelley Nielsen <kelleynnn at gmail.com>
Cc: Rik van Riel <riel at surriel.com>
Cc: Huang Ying <ying.huang at intel.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
DeltaFile
+9-9mm/shmem.c
+9-91 files

UnifiedSplitRaw