[LTP] [PATCH v3 0/3] Increase coverage for swapon syscall

Andrea Cervesato andrea.cervesato@suse.de
Fri Aug 28 13:10:51 CEST 2026


Complete the EINVAL coverage on invalid input data and create a new test
to verify discarding pages functionalities.

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
Changes in v3:
- better description for fallbacks
- swapon02: make sure we swapoff() if swapon() accidentally pass
- Link to v2: https://lore.kernel.org/20260828-swapon_discard_coverage-v2-0-e55a86dad729@suse.com

Changes in v2:
- ensure buffer is flushed after discard using fsync()
- add messages to show what test cases we are running
- Link to v1: https://lore.kernel.org/20260827-swapon_discard_coverage-v1-0-633bcb11c181@suse.com

---
Andrea Cervesato (3):
      tse_swap: Add fallback definitions for swapon
      swapon04: Add test for discard flags
      swapon02: Add test cases for invalid swapflags

 include/tse_swap.h                          |  16 +++
 runtest/syscalls                            |   1 +
 testcases/kernel/syscalls/swapon/.gitignore |   1 +
 testcases/kernel/syscalls/swapon/swapon02.c |  60 ++++++--
 testcases/kernel/syscalls/swapon/swapon04.c | 204 ++++++++++++++++++++++++++++
 5 files changed, 267 insertions(+), 15 deletions(-)
---
base-commit: 8e6b93c2832ff4940091abafefd8b8f97539ff5b
change-id: 20260827-swapon_discard_coverage-34861d63fc55

Best regards,
--  
Andrea Cervesato <andrea.cervesato@suse.com>



More information about the ltp mailing list