From nobody Tue Feb 10 04:14:19 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5062834DB5D; Wed, 7 Jan 2026 16:49:06 +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=1767804554; cv=none; b=FCfHNi2IBrfaKBphBjHgDlYQKGWqBlqfhUGSkPUuWuFg6huPBNeH134Div623gEejmFsmwvt/SA4D7VQov0GquvLR+/ky/g3AFy9R17W5A06J2UgHczHSN0KU6zli4qrNXuK7HxAhIPQenXYFZ1wuxGE4WH7JrNvVW/ypCwbnCI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767804554; c=relaxed/simple; bh=CoBX3U6/CdMfDJGL6JKNGPROstMKemI+6RCXCNxZfLw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JclapCG/LLTHtWXUDOihQ/58anbAHmcUBJOMIMUap+uZMz0NIDmCkedOKJSVCSE7ZSjgn3/kioiduHPrisaR99XcaScq7mfxT/Ikj8qtkDsboIys/6Aao5829PVFdqgpdYIGPc8iH32AGYEtYQ+PekJ5F+XxwZd7ETaVCRZrpMs= 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; 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 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 30ED91688; Wed, 7 Jan 2026 08:48:55 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A8FAC3F5A1; Wed, 7 Jan 2026 08:49:00 -0800 (PST) From: Kevin Brodsky To: linux-mm@kvack.org, linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Mark Brown , Ryan Roberts , Shuah Khan , Usama Anjum Subject: [PATCH v2 7/8] selftests/mm: fix exit code in pagemap_ioctl Date: Wed, 7 Jan 2026 16:48:41 +0000 Message-ID: <20260107164842.3289559-8-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260107164842.3289559-1-kevin.brodsky@arm.com> References: <20260107164842.3289559-1-kevin.brodsky@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: quoted-printable Content-Type: text/plain; charset="utf-8" Make sure pagemap_ioctl exits with an appropriate value: * If the tests are run, call ksft_finished() to report the right status instead of reporting PASS unconditionally. * Report SKIP if userfaultfd isn't available (in line with other tests) * Report FAIL if we failed to open /proc/self/pagemap, as this file has been added a long time ago and doesn't depend on any CONFIG option (returning -EINVAL from main() is meaningless) Cc: Usama Anjum Reviewed-by: Ryan Roberts Reviewed-by: Mark Brown Acked-by: David Hildenbrand (Red Hat) Signed-off-by: Kevin Brodsky Acked-by: SeongJae Park Reviewed-by: Dev Jain Reviewed-by: wang lian --- tools/testing/selftests/mm/pagemap_ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/sel= ftests/mm/pagemap_ioctl.c index 80d7c391f8f5..7b214e8755f7 100644 --- a/tools/testing/selftests/mm/pagemap_ioctl.c +++ b/tools/testing/selftests/mm/pagemap_ioctl.c @@ -1551,7 +1551,7 @@ int main(int __attribute__((unused)) argc, char *argv= []) ksft_print_header(); =20 if (init_uffd()) - ksft_exit_pass(); + ksft_exit_skip("Failed to initialize userfaultfd\n"); =20 ksft_set_plan(117); =20 @@ -1560,7 +1560,7 @@ int main(int __attribute__((unused)) argc, char *argv= []) =20 pagemap_fd =3D open(PAGEMAP, O_RDONLY); if (pagemap_fd < 0) - return -EINVAL; + ksft_exit_fail_msg("Failed to open " PAGEMAP "\n"); =20 /* 1. Sanity testing */ sanity_tests_sd(); @@ -1732,5 +1732,5 @@ int main(int __attribute__((unused)) argc, char *argv= []) zeropfn_tests(); =20 close(pagemap_fd); - ksft_exit_pass(); + ksft_finished(); } --=20 2.51.2