ltp icon indicating copy to clipboard operation
ltp copied to clipboard

libswap: fix tst_max_swapfiles() for SWP_SWAPIN_ERROR_NUM

Open akaher opened this issue 1 year ago • 0 comments

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.

akaher avatar Aug 27 '24 06:08 akaher