Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] read_all: Fix buffer too small for long paths
@ 2026-09-06 13:56 Michael Menasherov via ltp
  2026-09-06 16:02 ` [LTP] " linuxtestproject.agent
  2026-09-07  6:40 ` [LTP] [PATCH] " Andrea Cervesato via ltp
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Menasherov via ltp @ 2026-09-06 13:56 UTC (permalink / raw)
  To: ltp

queue_pop() copies each path into popped[BUFFER_SIZE], but BUFFER_SIZE
was 1024 while visit_dir() builds paths up to MAX_PATH (4096). Any path
longer than 1023 bytes aborted the test with TBROK "Buffer is too small
for path".

Set BUFFER_SIZE to 4096 to match MAX_PATH. QUEUE_SIZE (16384) still
holds a full-length path.

Tested on smaller boards and then on local machines with deeply nested
directories under /sys; read_all_sys now passes instead of aborting.

Fixes: 67c95fbbfc3a ("Add read_all file systems test")
Signed-off-by: Michael Menasherov <mmenashe@redhat.com>
---
 testcases/kernel/fs/read_all/read_all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c
index 5720ffb99..d67fe5712 100644
--- a/testcases/kernel/fs/read_all/read_all.c
+++ b/testcases/kernel/fs/read_all/read_all.c
@@ -51,7 +51,7 @@
 #include "tst_timer.h"
 
 #define QUEUE_SIZE 16384
-#define BUFFER_SIZE 1024
+#define BUFFER_SIZE 4096
 #define MAX_PATH 4096
 #define MAX_DISPLAY 40
 
-- 
2.55.0


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

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

end of thread, other threads:[~2026-09-07  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-06 13:56 [LTP] [PATCH] read_all: Fix buffer too small for long paths Michael Menasherov via ltp
2026-09-06 16:02 ` [LTP] " linuxtestproject.agent
2026-09-07  6:40 ` [LTP] [PATCH] " 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