[LTP] lapi: fallback definitions for swapon syscall

Andrea Cervesato andrea.cervesato@suse.com
Fri Aug 28 13:07:34 CEST 2026


> --- [PATCH 1/3] ---
> 
> > lapi: fallback definitions for swapon syscall
> >
> > Introduce fallback definition inside lapi for:
> 
> Could the subject and body name include/tse_swap.h rather than lapi? The
> fallback definitions are not added under include/lapi/, so the current
> component and location do not match the patch.
> 
> --- [PATCH 3/3] ---
> 
> > +	TST_EXP_FAIL(tst_syscall(__NR_swapon, tc->path, tc->flags), tc->exp_errno,
> >  		     "swapon(2) fail with %s", tc->err_desc);
> >
> >  static void cleanup(void)
> >  {
> >  	if (do_swapoff && tst_syscall(__NR_swapoff, USED_FILE))
> >  		tst_res(TWARN | TERRNO, "swapoff(alreadyused) failed");
> >  }
> 
> Could an unexpected successful swapon() of SWAP_FILE be tracked and undone?
> This is the failure mode these new cases are intended to detect, but
> TST_EXP_FAIL() only reports TFAIL. The swap area remains active, the next
> case gets EBUSY, and cleanup only disables USED_FILE, so the test filesystem
> cannot be unmounted.

These are both correct, I will fix them in the next version.

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


More information about the ltp mailing list