From: Michael Menasherov via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] read_all: Fix buffer too small for long paths
Date: Mon, 7 Sep 2026 15:03:08 +0300 [thread overview]
Message-ID: <20260907120308.32898-1-mmenashe@redhat.com> (raw)
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 and MAX_PATH to PATH_MAX so all path buffers and size
limits use the standard constant consistently.
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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c
index 5720ffb99..bf5f613a3 100644
--- a/testcases/kernel/fs/read_all/read_all.c
+++ b/testcases/kernel/fs/read_all/read_all.c
@@ -51,8 +51,8 @@
#include "tst_timer.h"
#define QUEUE_SIZE 16384
-#define BUFFER_SIZE 1024
-#define MAX_PATH 4096
+#define BUFFER_SIZE PATH_MAX
+#define MAX_PATH PATH_MAX
#define MAX_DISPLAY 40
struct queue {
--
2.55.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2026-09-07 12:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 12:03 Michael Menasherov via ltp [this message]
2026-09-07 14:58 ` [LTP] read_all: Fix buffer too small for long paths linuxtestproject.agent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260907120308.32898-1-mmenashe@redhat.com \
--to=ltp@lists.linux.it \
--cc=mmenashe@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox