Like NFS, FUSE reports on close() the -EIO that MADV_HWPOISON records in the mapping of a dirty page-cache page, as fuse_flush() calls filemap_check_errors(). Run from a virtiofs directory, e.g. in a virtme-ng guest, the hard dirty_pagecache variant fails on its final close(): memory-failure.c:389:dirty_pagecache:Expected close(fd) (-1) == 0 (0) Skip it on FUSE, as commit e14e52a7ce02 ("selftests/mm: skip hard dirty page-cache test on NFS") does for NFS. An AI coding assistant (Claude) was used to find the failure, write the fix and draft this changelog. Fixes: d51b5076c746 ("selftests/mm: add memory failure dirty pagecache test") Signed-off-by: Kurt Lin --- Tested in a virtme-ng guest, memory-failure built from mm-new with and without this patch, hwpoison_inject loaded: cwd on before after virtiofs 9 pass, 1 fail 9 pass, 1 skip ext4 (loop) 10 pass 10 pass run_vmtests.sh -t memory-failure from the virtiofs directory passes with the patch. The soft dirty_pagecache variant keeps running on FUSE and passes. FUSE servers that open files with FOPEN_NOFLUSH do not report the error on close(), so the variant could run there; it is skipped with the rest. --- tools/testing/selftests/mm/memory-failure.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/memory-failure.c b/tools/testing/selftests/mm/memory-failure.c index 135a2e8069ba..72a29ec19692 100644 --- a/tools/testing/selftests/mm/memory-failure.c +++ b/tools/testing/selftests/mm/memory-failure.c @@ -355,11 +355,12 @@ TEST_F(memory_failure, dirty_pagecache) fs_type = get_fs_type(fd); /* * MADV_HARD poisoning of dirty page-cache data records an expected - * -EIO in the file mapping. NFS reports this error on close(), so - * skip this variant. + * -EIO in the file mapping. NFS and FUSE report this error on + * close(), so skip this variant. */ if (!fs_type || fs_type == TMPFS_MAGIC || - (fs_type == NFS_SUPER_MAGIC && variant->type == MADV_HARD)) { + ((fs_type == NFS_SUPER_MAGIC || fs_type == FUSE_SUPER_MAGIC) && + variant->type == MADV_HARD)) { close(fd); SKIP(return, "unsupported filesystem :%x\n", fs_type); } --- base-commit: 7d1a16abe4cc5dccd21e3d6262e44433a5885d27 change-id: 20261123-memory-failure-fuse-skip-b976b4ea035b Best regards, -- Kurt Lin