Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/mm: add messages about test errors to the cow tests

It is not sufficiently clear what the individual tests in the cow test
program are checking so add messages for the failure cases.

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

authored by

Mark Brown and committed by
Andrew Morton
4ff52d4a 32dc2d5e

+20 -8
+20 -8
tools/testing/selftests/mm/cow.c
··· 268 268 * fail because (a) harder to fix and (b) nobody really cares. 269 269 * Flag them as expected failure for now. 270 270 */ 271 + ksft_print_msg("Leak from parent into child\n"); 271 272 log_test_result(KSFT_XFAIL); 272 273 } else { 274 + ksft_print_msg("Leak from parent into child\n"); 273 275 log_test_result(KSFT_FAIL); 274 276 } 275 277 close_comm_pipes: ··· 399 397 * fail because (a) harder to fix and (b) nobody really cares. 400 398 * Flag them as expected failure for now. 401 399 */ 400 + ksft_print_msg("Leak from child into parent\n"); 402 401 log_test_result(KSFT_XFAIL); 403 402 } else { 403 + ksft_print_msg("Leak from child into parent\n"); 404 404 log_test_result(KSFT_FAIL); 405 405 } 406 406 close_pipe: ··· 574 570 } 575 571 576 572 /* Finally, check if we read what we expected. */ 577 - if (!memcmp(mem, tmp, size)) 573 + if (!memcmp(mem, tmp, size)) { 578 574 log_test_result(KSFT_PASS); 579 - else 575 + } else { 576 + ksft_print_msg("Longtom R/W pin is not reliable\n"); 580 577 log_test_result(KSFT_FAIL); 578 + } 581 579 582 580 quit_child: 583 581 if (use_fork) { ··· 731 725 ksft_perror("PIN_LONGTERM_TEST_READ failed"); 732 726 log_test_result(KSFT_FAIL); 733 727 } else { 734 - if (!memcmp(mem, tmp, size)) 728 + if (!memcmp(mem, tmp, size)) { 735 729 log_test_result(KSFT_PASS); 736 - else 730 + } else { 731 + ksft_print_msg("Longterm R/O pin is not reliable\n"); 737 732 log_test_result(KSFT_FAIL); 733 + } 738 734 } 739 735 740 736 ret = ioctl(gup_fd, PIN_LONGTERM_TEST_STOP); ··· 1425 1417 else 1426 1418 ret = -EINVAL; 1427 1419 1428 - if (!ret) 1420 + if (!ret) { 1429 1421 log_test_result(KSFT_PASS); 1430 - else 1422 + } else { 1423 + ksft_print_msg("Leak from parent into child\n"); 1431 1424 log_test_result(KSFT_FAIL); 1425 + } 1432 1426 close_comm_pipes: 1433 1427 close_comm_pipes(&comm_pipes); 1434 1428 } ··· 1538 1528 memset(mem, 0xff, size); 1539 1529 1540 1530 /* See if we still read the old values via the other mapping. */ 1541 - if (!memcmp(smem, old, size)) 1531 + if (!memcmp(smem, old, size)) { 1542 1532 log_test_result(KSFT_PASS); 1543 - else 1533 + } else { 1534 + ksft_print_msg("Other mapping modified\n"); 1544 1535 log_test_result(KSFT_FAIL); 1536 + } 1545 1537 free(old); 1546 1538 } 1547 1539