* [LTP] [PATCH v1] zram03: unload zram when it is loaded during test run
@ 2022-09-05 7:43 Xiao Liang
2022-09-05 9:15 ` Petr Vorel
0 siblings, 1 reply; 4+ messages in thread
From: Xiao Liang @ 2022-09-05 7:43 UTC (permalink / raw)
To: ltp; +Cc: xiliang
Signed-off-by: Xiao Liang <xiliang@redhat.com>
---
testcases/kernel/device-drivers/zram/zram03.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/testcases/kernel/device-drivers/zram/zram03.c b/testcases/kernel/device-drivers/zram/zram03.c
index b9867a573..98eb61e1c 100644
--- a/testcases/kernel/device-drivers/zram/zram03.c
+++ b/testcases/kernel/device-drivers/zram/zram03.c
@@ -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");
--
2.37.2
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [LTP] [PATCH v1] zram03: unload zram when it is loaded during test run
2022-09-05 7:43 [LTP] [PATCH v1] zram03: unload zram when it is loaded during test run Xiao Liang
@ 2022-09-05 9:15 ` Petr Vorel
2022-09-05 10:15 ` Petr Vorel
0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2022-09-05 9:15 UTC (permalink / raw)
To: Xiao Liang; +Cc: ltp
Hi Xiao,
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Indeed, test does not unload zram on older kernels without zram-control
interface. Good catch!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH v1] zram03: unload zram when it is loaded during test run
2022-09-05 9:15 ` Petr Vorel
@ 2022-09-05 10:15 ` Petr Vorel
2022-09-05 12:10 ` Frank Liang
0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2022-09-05 10:15 UTC (permalink / raw)
To: Xiao Liang, ltp
Hi Xiao,
> 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
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH v1] zram03: unload zram when it is loaded during test run
2022-09-05 10:15 ` Petr Vorel
@ 2022-09-05 12:10 ` Frank Liang
0 siblings, 0 replies; 4+ messages in thread
From: Frank Liang @ 2022-09-05 12:10 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
[-- Attachment #1.1: Type: text/plain, Size: 350 bytes --]
Thanks, Petr
Rgs,
Frank
On Mon, Sep 5, 2022 at 6:16 PM Petr Vorel <pvorel@suse.cz> wrote:
> Hi Xiao,
>
> > 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
>
>
[-- Attachment #1.2: Type: text/html, Size: 695 bytes --]
[-- Attachment #2: Type: text/plain, Size: 60 bytes --]
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-05 12:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-05 7:43 [LTP] [PATCH v1] zram03: unload zram when it is loaded during test run Xiao Liang
2022-09-05 9:15 ` Petr Vorel
2022-09-05 10:15 ` Petr Vorel
2022-09-05 12:10 ` Frank Liang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.