From: Andrew Morton Subject: selftests/mm/memory-failure: skip hard dirty page-cache test on CephFS Date: Mon, 23 Nov 2026 08:29:47 -0800 CephFS loses the mapping error from a hard-poisoned dirty page: file_write_and_wait_range() returns -EIO and advances the file's writeback-error cursor, but ceph_fsync() overwrites that return value with a successful ceph_wait_on_async_create(). Its later error check finds nothing, so fsync() returns zero. In a CephFS QEMU guest, the hard-dirty selftest then failed its fsync() assertion. The page remained poisoned, teardown returned -EBUSY, and the following soft-dirty test died on the file left behind by the failed hard-dirty test. The soft-dirty test passed on a fresh file. Skip only the CephFS hard-dirty case before poisoning the page. The other CephFS tests still run. Remove the skip when ceph_fsync() reports the writeback error. Signed-off-by: Andrew Morton Cc: Amir Goldstein Cc: David Hildenbrand Cc: Eugenio Pérez Cc: German Maglione Cc: Kurt Lin Cc: Liam R. Howlett Cc: Miaohe Lin Cc: Michal Hocko Cc: Mike Rapoport Cc: Miklos Szeredi Cc: Muhammad Usama Anjum Cc: Naoya Horiguchi Cc: Ryusuke Konishi Cc: Shuah Khan Cc: Stefan Hajnoczi Cc: Vivek Goyal Cc: Vlastimil Babka tools/testing/selftests/mm/memory-failure.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/tools/testing/selftests/mm/memory-failure.c~selftests-mm-check-that-fsync-reports-hard-poisoned-dirty-page-cache-fix-3 +++ a/tools/testing/selftests/mm/memory-failure.c @@ -395,6 +395,15 @@ TEST_F(memory_failure, dirty_pagecache) close(fd); SKIP(return, "nilfs2 fsync() does not report poisoned dirty data\n"); } + /* + * ceph_fsync() loses the writeback error recorded for a poisoned + * dirty page. Remove this skip when it preserves that error. + */ + if (fs_type == CEPH_SUPER_MAGIC && variant->type == MADV_HARD) { + unlink(fname); + close(fd); + SKIP(return, "cephfs fsync() does not report poisoned dirty data\n"); + } addr = mmap(0, self->page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); _