From: Jinseok Kim <always.starving0@gmail.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] fstat02: Verify st_ino field
Date: Fri, 5 Jun 2026 00:06:41 +0900 [thread overview]
Message-ID: <20260604150643.3433-1-always.starving0@gmail.com> (raw)
fstat01 does not currently verify the st_ino field.
Add a check to verify that fstat() reports the expected inode number,
improving coverage of the metadata returned by fstat().
Signed-off-by: Jinseok Kim <always.starving0@gmail.com>
---
testcases/kernel/syscalls/fstat/fstat02.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/testcases/kernel/syscalls/fstat/fstat02.c b/testcases/kernel/syscalls/fstat/fstat02.c
index 68cbe82f0..e7175cfac 100644
--- a/testcases/kernel/syscalls/fstat/fstat02.c
+++ b/testcases/kernel/syscalls/fstat/fstat02.c
@@ -19,6 +19,7 @@
#define NLINK 2
static struct stat stat_buf;
+static struct stat link_stat_buf;
static uid_t user_id;
static gid_t group_id;
static int fildes;
@@ -31,6 +32,7 @@ static void run(void)
TST_EXP_EQ_LI(stat_buf.st_size, FILE_SIZE);
TST_EXP_EQ_LU(stat_buf.st_mode & 0777, FILE_MODE);
TST_EXP_EQ_LU(stat_buf.st_nlink, NLINK);
+ TST_EXP_EQ_LU(stat_buf.st_ino, link_stat_buf.st_ino);
}
static void setup(void)
@@ -46,6 +48,8 @@ static void setup(void)
tst_brk(TBROK, "Could not fill test file");
SAFE_LINK(TESTFILE, LINK_TESTFILE);
+
+ SAFE_STAT(LINK_TESTFILE, &link_stat_buf);
}
static void cleanup(void)
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2026-06-04 15:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 15:06 Jinseok Kim [this message]
2026-06-04 17:57 ` [LTP] fstat02: Verify st_ino field linuxtestproject.agent
2026-06-15 11:46 ` [LTP] [PATCH] " Andrea Cervesato via ltp
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=20260604150643.3433-1-always.starving0@gmail.com \
--to=always.starving0@gmail.com \
--cc=ltp@lists.linux.it \
/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