]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/mm: convert some cow error reports to ksft_perror()
authorMark Brown <broonie@kernel.org>
Tue, 10 Jun 2025 14:13:55 +0000 (15:13 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 10 Jul 2025 05:42:04 +0000 (22:42 -0700)
This prints the errno and a string decode of it.

Link: https://lkml.kernel.org/r/20250610-selftest-mm-cow-tweaks-v1-2-43cd7457500f@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/cow.c

index 0adc0ab142c12d56d16c7a7e3603dd442eb0af82..ff80329313e4a62070a94952019680b180c4de66 100644 (file)
@@ -332,7 +332,7 @@ static void do_test_vmsplice_in_parent(char *mem, size_t size,
        if (before_fork) {
                transferred = vmsplice(fds[1], &iov, 1, 0);
                if (transferred <= 0) {
-                       ksft_print_msg("vmsplice() failed\n");
+                       ksft_perror("vmsplice() failed\n");
                        log_test_result(KSFT_FAIL);
                        goto close_pipe;
                }
@@ -562,7 +562,7 @@ static void do_test_iouring(char *mem, size_t size, bool use_fork)
        while (total < size) {
                cur = pread(fd, tmp + total, size - total, total);
                if (cur < 0) {
-                       ksft_print_msg("pread() failed\n");
+                       ksft_perror("pread() failed\n");
                        log_test_result(KSFT_FAIL);
                        goto quit_child;
                }
@@ -628,7 +628,7 @@ static void do_test_ro_pin(char *mem, size_t size, enum ro_pin_test test,
 
        tmp = malloc(size);
        if (!tmp) {
-               ksft_print_msg("malloc() failed\n");
+               ksft_perror("malloc() failed\n");
                log_test_result(KSFT_FAIL);
                return;
        }