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 A0804429CC8; Fri, 24 Jul 2026 10:25:02 +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=1784888705; cv=none; b=lkP5dw9NEc6ZpOyYoQgWP/I712g9aO1+2DOO4/0RyQdIBkSirmHnrzK7f61eyrYAqW2LZKn74g+p2D7gNVVIFCX2aLdknQNhO8h4oM4jqT8GwV4nXNJ7/YtDiVFA8VqH6aVK7dCZ7Pkf65C1uffxo+og2FCMcIhobCwtQbYEmxU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784888705; c=relaxed/simple; bh=EfYVwz+NK1/iRlKs2gYESBuvvKYJIJMJC6PoEmXo+N8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BbizyUki55/XPPPE8lzIH8wCV8fbvOdyt7qCn7O8mqbvim+k1FOQZQXLVqH6yARW5itAVAaxM9MQzknqYzd0TPj8wPb1XcAgbGi41NT/uLQYZqu101nJzgqN2glsET4r2XlQqFfewL4yzl7SDqMU/TQgYGnOZ3e2Zgjq2wbvxpg= 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=su4bVAnm; 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="su4bVAnm" 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 285471595; Fri, 24 Jul 2026 03:24:57 -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 227853F66F; Fri, 24 Jul 2026 03:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1784888701; bh=EfYVwz+NK1/iRlKs2gYESBuvvKYJIJMJC6PoEmXo+N8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=su4bVAnmZBoo2ATbYQzURgZRjznCKZUwulbqfhLZZiOBoMjqIQ35Hxafm0nvpLpyN aBCNKx1AWIm+hFSLyGvxrPvOjkzmRd6Pif3wv+bV3IKeyS1Ds3KaXKozIMKFQYTIq2 jSxXF2o334/FJKgadnG7nlb2ga1BsRyB+LT1spdI= 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 1/5] selftests/mm: skip COW tmpfile cases when fallocate() is unsupported Date: Fri, 24 Jul 2026 11:24:24 +0100 Message-ID: <20260724102431.1199519-2-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 tmpfile-backed COW cases allocate a one-page file with fallocate() before exercising private and shared mappings. When the filesystem backing tmpfile() does not implement fallocate(), setup fails with EOPNOTSUPP and no COW behavior is exercised. This occurs when the temporary directory resides on a filesystem with limited allocation support, such as NFSv3. Reporting a failure adds noise because the test prerequisite is absent rather than the COW implementation being broken. Report EOPNOTSUPP as a skip. Continue treating every other fallocate() error as a failure so unexpected setup regressions remain visible. Tested-by: Sarthak Sharma Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/cow.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c index 0c627ea89ff7b..c1b8920e29342 100644 --- a/tools/testing/selftests/mm/cow.c +++ b/tools/testing/selftests/mm/cow.c @@ -1718,8 +1718,13 @@ static void run_with_tmpfile(non_anon_test_fn fn, const char *desc) /* File consists of a single page filled with zeroes. */ if (fallocate(fd, 0, 0, pagesize)) { - ksft_perror("fallocate() failed"); - log_test_result(KSFT_FAIL); + if (errno == EOPNOTSUPP) { + ksft_print_msg("fallocate() not supported by filesystem\n"); + log_test_result(KSFT_SKIP); + } else { + ksft_perror("fallocate() failed"); + log_test_result(KSFT_FAIL); + } goto close; } -- 2.47.3