mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
selftests/mm: skip hard dirty page-cache test on NFS
The hard dirty_pagecache variant uses MADV_HWPOISON to exercise recovery of a dirty file-backed page. The recovery path records -EIO in the address_space mapping, which NFS later reports when the test closes the file. This makes the test fail after the hwpoison checks have completed. Skip this variant when the test file is on NFS. Keep the hard clean-page and both soft-offline variants enabled because they use folio removal, invalidation, or migration rather than recording a delayed writeback error. The unsupported-filesystem path in clean_pagecache() also returns without closing the opened test file. Close the descriptor before skipping there and in dirty_pagecache(). Link: https://lore.kernel.org/20260727095225.372655-5-usama.anjum@arm.com Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com> Reviewed-by: Miaohe Lin <linmiaohe@huawei.com> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Barry Song <baohua@kernel.org> Cc: David Hildenbrand <david@kernel.org> Cc: Dev Jain <dev.jain@arm.com> Cc: Lance Yang <lance.yang@linux.dev> Cc: Liam R. Howlett <liam@infradead.org> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Naoya Horiguchi <nao.horiguchi@gmail.com> Cc: Nico Pache <npache@redhat.com> Cc: Ryan Roberts <ryan.roberts@arm.com> Cc: Sarthak Sharma <sarthak.sharma@arm.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Usama Arif <usama.arif@linux.dev> Cc: Vlastimil Babka <vbabka@kernel.org> Cc: Zi Yan <ziy@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
e5220e4d93
commit
e14e52a7ce
|
|
@ -287,8 +287,10 @@ TEST_F(memory_failure, clean_pagecache)
|
|||
if (fd < 0)
|
||||
SKIP(return, "failed to open test file.\n");
|
||||
fs_type = get_fs_type(fd);
|
||||
if (!fs_type || fs_type == TMPFS_MAGIC)
|
||||
if (!fs_type || fs_type == TMPFS_MAGIC) {
|
||||
close(fd);
|
||||
SKIP(return, "unsupported filesystem :%x\n", fs_type);
|
||||
}
|
||||
|
||||
addr = mmap(0, self->page_size, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED, fd, 0);
|
||||
|
|
@ -327,8 +329,16 @@ TEST_F(memory_failure, dirty_pagecache)
|
|||
if (fd < 0)
|
||||
SKIP(return, "failed to open test file.\n");
|
||||
fs_type = get_fs_type(fd);
|
||||
if (!fs_type || fs_type == TMPFS_MAGIC)
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
if (!fs_type || fs_type == TMPFS_MAGIC ||
|
||||
(fs_type == NFS_SUPER_MAGIC && variant->type == MADV_HARD)) {
|
||||
close(fd);
|
||||
SKIP(return, "unsupported filesystem :%x\n", fs_type);
|
||||
}
|
||||
|
||||
addr = mmap(0, self->page_size, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED, fd, 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user