ltp
ltp copied to clipboard
libswap: fix tst_max_swapfiles() for SWP_SWAPIN_ERROR_NUM
swapon03 fails because it doesn't includes SWP_SWAPIN_ERROR_NUM to calculate MAX_SWAPFILES. However linux v5.19-v6.1.y includes, as:
#define MAX_SWAPFILES \
((1 << MAX_SWAPFILES_SHIFT) - SWP_DEVICE_NUM - \
SWP_MIGRATION_NUM - SWP_HWPOISON_NUM - \
SWP_PTE_MARKER_NUM - SWP_SWAPIN_ERROR_NUM)
Including SWP_SWAPIN_ERROR_NUM to calculate MAX_SWAPFILES, if Linux version is >= v5.19 and < v6.2.