Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] ksm: Fix sysfs path concatenation in ksm_test.h
@ 2026-06-08  7:44 Wei Gao via ltp
  2026-06-08  8:59 ` [LTP] " linuxtestproject.agent
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Wei Gao via ltp @ 2026-06-08  7:44 UTC (permalink / raw)
  To: ltp

The check() function in ksm_test.h was concatenating PATH_MM_KSM and
the relative path (e.g. "run") directly without a directory separator:

    snprintf(fullpath, BUFSIZ, PATH_MM_KSM "%s", path);

This resulted in invalid paths like "/sys/kernel/mm/ksmrun", causing
the tests to fail with TBROK (Failed to open FILE '/sys/kernel/mm/ksmrun').

Fix this by adding the missing slash between PATH_MM_KSM and the subpath.

Fixes: 40a366b53adc ("lib: Introduce tst_path_defs.h to consolidate system paths")
Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/kernel/mem/ksm/ksm_test.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/mem/ksm/ksm_test.h b/testcases/kernel/mem/ksm/ksm_test.h
index d04aa8e2b..d3f61edfb 100644
--- a/testcases/kernel/mem/ksm/ksm_test.h
+++ b/testcases/kernel/mem/ksm/ksm_test.h
@@ -13,7 +13,7 @@ static inline void check(char *path, long int value)
 	char fullpath[BUFSIZ];
 	long actual_val;
 
-	snprintf(fullpath, BUFSIZ, PATH_MM_KSM "%s", path);
+	snprintf(fullpath, BUFSIZ, PATH_MM_KSM "/%s", path);
 	SAFE_FILE_SCANF(fullpath, "%ld", &actual_val);
 
 	if (actual_val != value)
-- 
2.54.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [LTP] ksm: Fix sysfs path concatenation in ksm_test.h
  2026-06-08  7:44 [LTP] [PATCH v1] ksm: Fix sysfs path concatenation in ksm_test.h Wei Gao via ltp
@ 2026-06-08  8:59 ` linuxtestproject.agent
  2026-06-08  9:18   ` Cyril Hrubis
  2026-06-08 12:08 ` linuxtestproject.agent
  2026-06-09  8:24 ` [LTP] [PATCH v1] " Andrea Cervesato via ltp
  2 siblings, 1 reply; 6+ messages in thread
From: linuxtestproject.agent @ 2026-06-08  8:59 UTC (permalink / raw)
  To: Wei Gao; +Cc: ltp

Hi Wei,

On Mon, 8 Jun 2026 07:44:15 +0000, Wei Gao wrote:
> ksm: Fix sysfs path concatenation in ksm_test.h

> Fixes: 40a366b53adc ("lib: Introduce tst_path_defs.h to consolidate system paths")

This commit hash does not exist in the LTP repository. Could the
reference be verified and corrected?

Verdict: Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] ksm: Fix sysfs path concatenation in ksm_test.h
  2026-06-08  8:59 ` [LTP] " linuxtestproject.agent
@ 2026-06-08  9:18   ` Cyril Hrubis
  2026-06-08  9:20     ` Andrea Cervesato via ltp
  0 siblings, 1 reply; 6+ messages in thread
From: Cyril Hrubis @ 2026-06-08  9:18 UTC (permalink / raw)
  To: linuxtestproject.agent; +Cc: ltp

Hi!
> On Mon, 8 Jun 2026 07:44:15 +0000, Wei Gao wrote:
> > ksm: Fix sysfs path concatenation in ksm_test.h
> 
> > Fixes: 40a366b53adc ("lib: Introduce tst_path_defs.h to consolidate system paths")
> 
> This commit hash does not exist in the LTP repository. Could the
> reference be verified and corrected?
> 
> Verdict: Needs revision


@Andrea the bot still misses existing patches:

$ git log 40a366b53adc

commit 40a366b53adc477d950cc73f071b0cd4ebe25f85
Author: Li Wang <li.wang@linux.dev>
Date:   Thu Jun 4 17:41:59 2026 +0800

    lib: Introduce tst_path_defs.h to consolidate system paths

    We have a lot of hardcoded strings and duplicated macros for /proc
    and /sys paths scattered throughout the testcases.

    This patch introduces a new common header, tst_path_defs.h, to centralize
    and standardize these path definitions. By unifying these macros, we
    reduce code duplication, improve maintainability, and ensure consistent
    path usage across the entire LTP codebase.

    Signed-off-by: Li Wang <li.wang@linux.dev>
    Acked-by: Andrea Cervesato <andrea.cervesato@suse.com>
    Reviewed-by: Cyril Hrubis <chrubis@suse.cz>


-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] ksm: Fix sysfs path concatenation in ksm_test.h
  2026-06-08  9:18   ` Cyril Hrubis
@ 2026-06-08  9:20     ` Andrea Cervesato via ltp
  0 siblings, 0 replies; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-08  9:20 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp, linuxtestproject.agent

Hi Cyril,

> @Andrea the bot still misses existing patches:
> 
> $ git log 40a366b53adc
> 
> commit 40a366b53adc477d950cc73f071b0cd4ebe25f85
> Author: Li Wang <li.wang@linux.dev>
> Date:   Thu Jun 4 17:41:59 2026 +0800
> 
>     lib: Introduce tst_path_defs.h to consolidate system paths
> 
>     We have a lot of hardcoded strings and duplicated macros for /proc
>     and /sys paths scattered throughout the testcases.
> 
>     This patch introduces a new common header, tst_path_defs.h, to centralize
>     and standardize these path definitions. By unifying these macros, we
>     reduce code duplication, improve maintainability, and ensure consistent
>     path usage across the entire LTP codebase.
> 
>     Signed-off-by: Li Wang <li.wang@linux.dev>
>     Acked-by: Andrea Cervesato <andrea.cervesato@suse.com>
>     Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

Yes I seen, this is really annoying. I will find a way to fix it,
but it's supposed to be fixed already.

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] ksm: Fix sysfs path concatenation in ksm_test.h
  2026-06-08  7:44 [LTP] [PATCH v1] ksm: Fix sysfs path concatenation in ksm_test.h Wei Gao via ltp
  2026-06-08  8:59 ` [LTP] " linuxtestproject.agent
@ 2026-06-08 12:08 ` linuxtestproject.agent
  2026-06-09  8:24 ` [LTP] [PATCH v1] " Andrea Cervesato via ltp
  2 siblings, 0 replies; 6+ messages in thread
From: linuxtestproject.agent @ 2026-06-08 12:08 UTC (permalink / raw)
  To: Wei Gao; +Cc: ltp

Hi Wei,

On Mon, Jun 8, 2026 at 07:44:15AM +0000, Wei Gao wrote:
> ksm: Fix sysfs path concatenation in ksm_test.h

Verdict: Reviewed

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH v1] ksm: Fix sysfs path concatenation in ksm_test.h
  2026-06-08  7:44 [LTP] [PATCH v1] ksm: Fix sysfs path concatenation in ksm_test.h Wei Gao via ltp
  2026-06-08  8:59 ` [LTP] " linuxtestproject.agent
  2026-06-08 12:08 ` linuxtestproject.agent
@ 2026-06-09  8:24 ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-09  8:24 UTC (permalink / raw)
  To: Wei Gao via ltp; +Cc: ltp

Merged, Thanks!

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-09  8:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08  7:44 [LTP] [PATCH v1] ksm: Fix sysfs path concatenation in ksm_test.h Wei Gao via ltp
2026-06-08  8:59 ` [LTP] " linuxtestproject.agent
2026-06-08  9:18   ` Cyril Hrubis
2026-06-08  9:20     ` Andrea Cervesato via ltp
2026-06-08 12:08 ` linuxtestproject.agent
2026-06-09  8:24 ` [LTP] [PATCH v1] " Andrea Cervesato via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox