From: Andrew Morton Subject: selftests/mm/memory-failure: truncate poisoned FUSE page-cache before teardown Date: Mon, 23 Nov 2026 23:18:44 -0800 FUSE has no ->error_remove_folio(), so memory_failure() cannot evict a poisoned dirty page-cache page. The folio may remain after close() and unpoison_memory() can then return -EBUSY during selftest teardown. In tests with a minimal FUSE server, this happened in 6 of 40 runs. After checking that fsync() reports EIO, truncate the file so teardown can unpoison the page. Remove this cleanup when FUSE can evict the poisoned folio. Signed-off-by: Andrew Morton Cc: Miaohe Lin Cc: Naoya Horiguchi Cc: David Hildenbrand Cc: Liam R. Howlett Cc: Vlastimil Babka Cc: Mike Rapoport Cc: Michal Hocko Cc: Shuah Khan Cc: Muhammad Usama Anjum Cc: Miklos Szeredi Cc: Amir Goldstein Cc: Eugenio Pérez Cc: German Maglione Cc: Kurt Lin Cc: Ryusuke Konishi Cc: Stefan Hajnoczi Cc: Vivek Goyal tools/testing/selftests/mm/memory-failure.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/tools/testing/selftests/mm/memory-failure.c~selftests-mm-check-that-fsync-reports-hard-poisoned-dirty-page-cache-fix-0 +++ a/tools/testing/selftests/mm/memory-failure.c @@ -406,6 +406,13 @@ TEST_F(memory_failure, dirty_pagecache) if (variant->type == MADV_HARD) { ASSERT_EQ(fsync(fd), -1); ASSERT_EQ(errno, EIO); + /* + * A filesystem which could not remove the poisoned page from + * its page cache (FUSE, for one) keeps it until the inode is + * evicted, which can be after close() returns. Remove it now + * so that teardown can unpoison the page. + */ + ASSERT_EQ(ftruncate(fd, 0), 0); } ASSERT_EQ(close(fd), 0); _