]> 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)
commit8958a02daa3b4d376b41add399449df1371f2319
tree770f47b84357f3ef384863169aaae558875a6944
parentc47be7cbe993f29289d301231814db5c9251737e
Revert "mm: shmem: don't truncate page if memory failure happens"

This reverts commit 4f3ccb3c0da7c8e03522ae9b8b960ff6661364ef.

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