zram03: unload zram when it is loaded during test run
PATCH 1/1 zram03: unload zram when it is loaded during test run
Signed-off-by Xiao Liang <[email protected]>
--- testcases/kernel/device-drivers/zram/zram03.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
testcases/kernel/device-drivers/zram/zram03.c +8 -9
@@ -187,16 +187,15 @@ static void setup(void)/* zram module was built in or being used on old kernel */ SAFE_CMD (cmd_modprobe,NULL ,NULL ); -if (access (ZRAM_CONTROL_PATH ,F_OK )) { - file =SAFE_FOPEN ("/proc/modules" ,"r" ); -while (fgets (line,sizeof (line), file)) { -if (strstr (line,"zram" )) { - modprobe =1 ; -break ; - } + file =SAFE_FOPEN ("/proc/modules" ,"r" ); +while (fgets (line,sizeof (line), file)) { +if (strstr (line,"zram" )) { + modprobe =1 ; +break ; } -SAFE_FCLOSE (file); - + } +SAFE_FCLOSE (file); +if (access (ZRAM_CONTROL_PATH ,F_OK )) {if (modprobe) {tst_res (TINFO ,"rmmod zram before test on old kernel without zram-control interface" );
Signature · 5 lines
2.37.2 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Xiao,
Reviewed-by Petr Vorel <[email protected]>
Indeed, test does not unload zram on older kernels without zram-control interface. Good catch!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Xiao,
Quoted 2 lines
Indeed, test does not unload zram on older kernels without zram-control interface. Good catch!
I was wrong, for both cases the module was kept even not loaded before. Anyway merged, thanks for your fix!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Thanks, Petr
Rgs,
Frank
Quoted 11 lines · Petr Vorel
Hi Xiao,
Quoted 2 lines
Indeed, test does not unload zram on older kernels without zram-control interface. Good catch!
I was wrong, for both cases the module was kept even not loaded before. Anyway merged, thanks for your fix!
Kind regards,
Petr
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp