From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0317941F7D1; Fri, 24 Jul 2026 10:25:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784888721; cv=none; b=khTAK9w8hpFta1VPHi2AT/NSwLkWeq65QFiyjSysPRQ12nT39yyX6nhhMgFnj99296alsq6G982FzeX/PktW07FSx+k7zHwGinW9/FPRjp9X/p37YBeVbNi3W+aGnyDsKYuluhbiJFbfYDiExmICI4qeWM7d0QZDjbaevCVjZ04= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784888721; c=relaxed/simple; bh=gjhEdojn6ZH69RosJEQqB2oqwaUfEM3sBTnWP0w/g2k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bkjMUmaBhxKLNky9qMvbgDPYBhCyhJuC4iHxi195nZXWLFrE+9w2BzJ6Oo1+yFwV6S7obxYtYC7OxKvNJYcTSR2P6igKAkNVste0640g03y9+pqHkDSt6fFCij3GGDMgnm5xgPRSFQ0VWFHu4bYqbzAu9jiPXTsn2KWHUpckF/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=OAemU0+u; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="OAemU0+u" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CF5931477; Fri, 24 Jul 2026 03:25:13 -0700 (PDT) Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com [10.2.198.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 03FB13F66F; Fri, 24 Jul 2026 03:25:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1784888717; bh=gjhEdojn6ZH69RosJEQqB2oqwaUfEM3sBTnWP0w/g2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OAemU0+uVLTgy6K8UI65WLReaYHpNiL+wmtJLPZk5gycAjgiOTE/Slg8yl+Kx7qEn 6E/dCgnKnZlagJM2f3tiaG3HG7RVvbVNM+YiV/9fXOsHT4FxT/dV1XnVAJIeyCpWmb CQLc8U/xO8szAlH/Z52w4Hajp2pniG8CCVYFh2G8= From: Muhammad Usama Anjum To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Shuah Khan , Zi Yan , Baolin Wang , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Miaohe Lin , Naoya Horiguchi , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, sarthak.sharma@arm.com Cc: Muhammad Usama Anjum Subject: [PATCH v2 4/5] selftests/mm: skip hard dirty page-cache test on NFS Date: Fri, 24 Jul 2026 11:24:27 +0100 Message-ID: <20260724102431.1199519-5-usama.anjum@arm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260724102431.1199519-1-usama.anjum@arm.com> References: <20260724102431.1199519-1-usama.anjum@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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(). Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Limit the NFS skip to the hard dirty-page variant. --- tools/testing/selftests/mm/memory-failure.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/memory-failure.c b/tools/testing/selftests/mm/memory-failure.c index 032ed952057c6..3c72084f57e8b 100644 --- a/tools/testing/selftests/mm/memory-failure.c +++ b/tools/testing/selftests/mm/memory-failure.c @@ -283,8 +283,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); @@ -325,8 +327,11 @@ 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) + 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); -- 2.47.3