vts: kernel: Fix loop device configuration test
The VTS kernel loop config checks the max_loop module
parameter to ensure that it is 0, under the assumption
that the parameter controls the amount of loop devices
that can be allocated dynamically. This is not correct,
as that parameter is used to specify how many loop
devices are created when the loop device driver is
initialized.
Kernel commit 85c50197716c ("loop: Fix the max_loop commandline
argument treatment when it is set to 0") fixed the interpretation
of the max_loop parameter. When it is not set, it defaults
to CONFIG_BLK_DEV_LOOP_MIN_COUNT instead of 0, which this
test now deems as incorrect.
Instead, the test should just be ensuring that at least
CONFIG_BLK_DEV_LOOP_MIN_COUNT devices are created when the loop
device driver is initialized, and should fail if the max_loop
parameter overrides CONFIG_BLK_DEV_LOOP_MIN_COUNT with a value
that is less than it.
Since the fix is only applicable for kernels 5.15.86+, add the
new logic to interpret max_loop correctly for kernels that are
at version 5.15.86 or newer, and preserve the old interpretation
for older kernels.
Bug: 273149536
Bug: 339376351
Test: atest vts_kernel_loopconfig_test
Change-Id: I97fe2ed1ae048add28f256ba824f7414d0cc98be
Signed-off-by: Isaac J. Manjarres <[email protected]>
(cherry picked from commit ec8c642b15076c07040f935f37b90c5dc9fc47a3)
2 files changed