From: Jeff Layton via ltp <ltp@lists.linux.it>
To: Linux Test Project <ltp@lists.linux.it>
Cc: Mark Brown <broonie@kernel.org>, Jeff Layton <jlayton@kernel.org>
Subject: [LTP] [PATCH v2] ioctl10: fix the sscanf() call to handle 64-bit inode on 32-bit arch
Date: Fri, 26 Jun 2026 14:20:01 -0400 [thread overview]
Message-ID: <20260626-master-v2-1-d1365499b710@kernel.org> (raw)
This test started failing recently on arm32, when we switched the
kernel to displaying the full 64-bit inode number in the maps file.
Change the testcase to allow for a full 64-bit inode number on all
arches. The value it's compared to is already 64-bits, so widening
this field is all that is necessary.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Changes in v2:
- Use SCNu64 instead of %llu in the sscanf() format string
- Link to v1: https://lore.kernel.org/r/20260626-master-v1-1-e4fcb95b232d@kernel.org
---
testcases/kernel/syscalls/ioctl/ioctl10.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/ioctl/ioctl10.c b/testcases/kernel/syscalls/ioctl/ioctl10.c
index b668c9e93889..8a4f8ae405e6 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl10.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl10.c
@@ -17,6 +17,7 @@
#include "config.h"
#include <stdlib.h>
+#include <inttypes.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <fnmatch.h>
@@ -35,7 +36,7 @@ struct map_entry {
unsigned long vm_pgoff;
unsigned int vm_major;
unsigned int vm_minor;
- unsigned long vm_inode;
+ uint64_t vm_inode;
char vm_name[256];
unsigned int vm_flags;
};
@@ -68,7 +69,7 @@ static void parse_maps_file(const char *filename, const char *keyword, struct ma
while (fgets(line, sizeof(line), fp) != NULL) {
if (fnmatch(keyword, line, 0) == 0) {
- if (sscanf(line, "%lx-%lx %s %lx %x:%x %lu %s",
+ if (sscanf(line, "%lx-%lx %s %lx %x:%x %" SCNu64 " %s",
&entry->vm_start, &entry->vm_end, entry->vm_flags_str,
&entry->vm_pgoff, &entry->vm_major, &entry->vm_minor,
&entry->vm_inode, entry->vm_name) < 7)
---
base-commit: 534222c4f3908e9642f913399e37a66fdd266bbe
change-id: 20260626-master-55d29494ba06
Best regards,
--
Jeff Layton <jlayton@kernel.org>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2026-06-26 18:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 18:20 Jeff Layton via ltp [this message]
2026-06-26 19:49 ` [LTP] ioctl10: fix the sscanf() call to handle 64-bit inode on 32-bit arch linuxtestproject.agent
2026-06-28 6:46 ` [LTP] [PATCH v2] " Li Wang
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=20260626-master-v2-1-d1365499b710@kernel.org \
--to=ltp@lists.linux.it \
--cc=broonie@kernel.org \
--cc=jlayton@kernel.org \
/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