]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "mm: shmem: don't truncate page if memory failure happens"
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 13 Nov 2021 20:03:03 +0000 (12:03 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 13 Nov 2021 20:03:03 +0000 (12:03 -0800)
commit7f1feef5dd692138b238fe1d358e36a2c2cdab99
tree770f47b84357f3ef384863169aaae558875a6944
parent0cf47f85d8437d7b23028f489c882f11d7505d71
Revert "mm: shmem: don't truncate page if memory failure happens"

This reverts commit b7961a0376ce2ed60b1acec5abd6144b53d6dab8.

The error handling of that patch was fundamentally broken, and it needs
to be entirely re-done.

For example, in shmem_write_begin() it would call shmem_getpage(), then
ignore the error return from that, and look at the page pointer contents
instead.

And in shmem_read_mapping_page_gfp(), the patch tested PageHWPoison() on
a page pointer that two lines earlier had potentially been set as an
error pointer.

These issues could be individually fixed, but when it has this many
issues, I'm just reverting it instead of waiting for fixes.

Link: https://lore.kernel.org/linux-mm/20211111084617.6746-1-ajaygargnsit@gmail.com/
Reported-by: Ajay Garg <ajaygargnsit@gmail.com>
Reported-by: Jens Axboe <axboe@kernel.dk>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory-failure.c
mm/shmem.c
mm/userfaultfd.c