* [LTP] [PATCH 0/4] syscalls/cachestat01: minor improvements
@ 2026-07-08 9:11 Avinesh Kumar via ltp
2026-07-08 9:11 ` [LTP] [PATCH 1/4] syscalls/cachestat01: Remove redundant memset() on cachestat buffer Avinesh Kumar via ltp
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Avinesh Kumar via ltp @ 2026-07-08 9:11 UTC (permalink / raw)
To: ltp
A few small cleanups and a fix for an unchecked fsync() in cachestat01.
Avinesh Kumar (4):
syscalls/cachestat01: Remove redundant memset() on cachestat buffer
syscalls/cachestat01: Drop stray newline in tst_res() message
syscalls/cachestat01: Add spaces around '<<' operator
syscalls/cachestat01: Use SAFE_FSYNC() instead of fsync()
testcases/kernel/syscalls/cachestat/cachestat01.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--
2.54.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
* [LTP] [PATCH 1/4] syscalls/cachestat01: Remove redundant memset() on cachestat buffer
2026-07-08 9:11 [LTP] [PATCH 0/4] syscalls/cachestat01: minor improvements Avinesh Kumar via ltp
@ 2026-07-08 9:11 ` Avinesh Kumar via ltp
2026-07-08 10:21 ` [LTP] " linuxtestproject.agent
2026-07-08 9:11 ` [LTP] [PATCH 2/4] syscalls/cachestat01: Drop stray newline in tst_res() message Avinesh Kumar via ltp
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Avinesh Kumar via ltp @ 2026-07-08 9:11 UTC (permalink / raw)
To: ltp
From: Avinesh Kumar <avinesh.kumar@suse.com>
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
---
testcases/kernel/syscalls/cachestat/cachestat01.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/testcases/kernel/syscalls/cachestat/cachestat01.c b/testcases/kernel/syscalls/cachestat/cachestat01.c
index aa6f21d41d1a..ca2c2864a1d1 100644
--- a/testcases/kernel/syscalls/cachestat/cachestat01.c
+++ b/testcases/kernel/syscalls/cachestat/cachestat01.c
@@ -36,8 +36,6 @@ static void test_cached_pages(const unsigned int use_sync, const int num_pages)
tst_res(TINFO, "%s file synchronization", use_sync ? "Enable" : "Disable");
tst_res(TINFO, "Number of pages: %d", num_pages);
- memset(cs, 0, sizeof(struct cachestat));
-
fd = SAFE_OPEN(FILENAME, O_RDWR | O_CREAT, 0600);
for (int i = 0; i < num_pages; i++)
--
2.54.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [LTP] [PATCH 2/4] syscalls/cachestat01: Drop stray newline in tst_res() message
2026-07-08 9:11 [LTP] [PATCH 0/4] syscalls/cachestat01: minor improvements Avinesh Kumar via ltp
2026-07-08 9:11 ` [LTP] [PATCH 1/4] syscalls/cachestat01: Remove redundant memset() on cachestat buffer Avinesh Kumar via ltp
@ 2026-07-08 9:11 ` Avinesh Kumar via ltp
2026-07-08 9:11 ` [LTP] [PATCH 3/4] syscalls/cachestat01: Add spaces around '<<' operator Avinesh Kumar via ltp
2026-07-08 9:11 ` [LTP] [PATCH 4/4] syscalls/cachestat01: Use SAFE_FSYNC() instead of fsync() Avinesh Kumar via ltp
3 siblings, 0 replies; 7+ messages in thread
From: Avinesh Kumar via ltp @ 2026-07-08 9:11 UTC (permalink / raw)
To: ltp
From: Avinesh Kumar <avinesh.kumar@suse.com>
tst_res() appends its own newline, so this prints a blank line.
tst_test.c:1303: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_cacmJmF9g/mntpoint fstyp=ext2 flags=0
cachestat01.c:78: TINFO: Limiting num_shift to 3
cachestat01.c:36: TINFO: Disable file synchronization
cachestat01.c:37: TINFO: Number of pages: 1
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
---
testcases/kernel/syscalls/cachestat/cachestat01.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/cachestat/cachestat01.c b/testcases/kernel/syscalls/cachestat/cachestat01.c
index ca2c2864a1d1..7cc72cc1bf21 100644
--- a/testcases/kernel/syscalls/cachestat/cachestat01.c
+++ b/testcases/kernel/syscalls/cachestat/cachestat01.c
@@ -73,7 +73,7 @@ static void setup(void)
for (num_shift = 0; num_shift <= 15; num_shift++) {
if ((1lu<<num_shift) * page_size / 1024 >= tst_device->size) {
- tst_res(TINFO, "Limiting num_shift to %i\n", num_shift);
+ tst_res(TINFO, "Limiting num_shift to %i", num_shift);
break;
}
}
--
2.54.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [LTP] [PATCH 3/4] syscalls/cachestat01: Add spaces around '<<' operator
2026-07-08 9:11 [LTP] [PATCH 0/4] syscalls/cachestat01: minor improvements Avinesh Kumar via ltp
2026-07-08 9:11 ` [LTP] [PATCH 1/4] syscalls/cachestat01: Remove redundant memset() on cachestat buffer Avinesh Kumar via ltp
2026-07-08 9:11 ` [LTP] [PATCH 2/4] syscalls/cachestat01: Drop stray newline in tst_res() message Avinesh Kumar via ltp
@ 2026-07-08 9:11 ` Avinesh Kumar via ltp
2026-07-08 9:11 ` [LTP] [PATCH 4/4] syscalls/cachestat01: Use SAFE_FSYNC() instead of fsync() Avinesh Kumar via ltp
3 siblings, 0 replies; 7+ messages in thread
From: Avinesh Kumar via ltp @ 2026-07-08 9:11 UTC (permalink / raw)
To: ltp
From: Avinesh Kumar <avinesh.kumar@suse.com>
$ make check-cachestat01
CHECK testcases/kernel/syscalls/cachestat/cachestat01.c
cachestat01.c:75: CHECK: spaces preferred around that '<<' (ctx:VxV)
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
---
testcases/kernel/syscalls/cachestat/cachestat01.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/cachestat/cachestat01.c b/testcases/kernel/syscalls/cachestat/cachestat01.c
index 7cc72cc1bf21..1db530ffe9e5 100644
--- a/testcases/kernel/syscalls/cachestat/cachestat01.c
+++ b/testcases/kernel/syscalls/cachestat/cachestat01.c
@@ -72,7 +72,7 @@ static void setup(void)
page_size = (int)sysconf(_SC_PAGESIZE);
for (num_shift = 0; num_shift <= 15; num_shift++) {
- if ((1lu<<num_shift) * page_size / 1024 >= tst_device->size) {
+ if ((1lu << num_shift) * page_size / 1024 >= tst_device->size) {
tst_res(TINFO, "Limiting num_shift to %i", num_shift);
break;
}
--
2.54.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [LTP] [PATCH 4/4] syscalls/cachestat01: Use SAFE_FSYNC() instead of fsync()
2026-07-08 9:11 [LTP] [PATCH 0/4] syscalls/cachestat01: minor improvements Avinesh Kumar via ltp
` (2 preceding siblings ...)
2026-07-08 9:11 ` [LTP] [PATCH 3/4] syscalls/cachestat01: Add spaces around '<<' operator Avinesh Kumar via ltp
@ 2026-07-08 9:11 ` Avinesh Kumar via ltp
2026-07-08 13:40 ` Petr Vorel
3 siblings, 1 reply; 7+ messages in thread
From: Avinesh Kumar via ltp @ 2026-07-08 9:11 UTC (permalink / raw)
To: ltp
From: Avinesh Kumar <avinesh.kumar@suse.com>
Success of fsync() is not checked. Use SAFE_FSYNC() instead so that a
failed synchronization is reported instead of being silently ignored.
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
---
testcases/kernel/syscalls/cachestat/cachestat01.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/cachestat/cachestat01.c b/testcases/kernel/syscalls/cachestat/cachestat01.c
index 1db530ffe9e5..1ba0f9888f0f 100644
--- a/testcases/kernel/syscalls/cachestat/cachestat01.c
+++ b/testcases/kernel/syscalls/cachestat/cachestat01.c
@@ -42,7 +42,7 @@ static void test_cached_pages(const unsigned int use_sync, const int num_pages)
SAFE_WRITE(0, fd, page_data, page_size);
if (use_sync)
- fsync(fd);
+ SAFE_FSYNC(fd);
cs_range->off = 0;
cs_range->len = page_size * num_pages;
--
2.54.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [LTP] syscalls/cachestat01: Remove redundant memset() on cachestat buffer
2026-07-08 9:11 ` [LTP] [PATCH 1/4] syscalls/cachestat01: Remove redundant memset() on cachestat buffer Avinesh Kumar via ltp
@ 2026-07-08 10:21 ` linuxtestproject.agent
0 siblings, 0 replies; 7+ messages in thread
From: linuxtestproject.agent @ 2026-07-08 10:21 UTC (permalink / raw)
To: Avinesh Kumar; +Cc: ltp
Hi Avinesh,
On Wed, 8 Jul 2026 11:11:51 +0200, Avinesh Kumar wrote:
> syscalls/cachestat01: Remove redundant memset() on cachestat buffer
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] 7+ messages in thread
* Re: [LTP] [PATCH 4/4] syscalls/cachestat01: Use SAFE_FSYNC() instead of fsync()
2026-07-08 9:11 ` [LTP] [PATCH 4/4] syscalls/cachestat01: Use SAFE_FSYNC() instead of fsync() Avinesh Kumar via ltp
@ 2026-07-08 13:40 ` Petr Vorel
0 siblings, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2026-07-08 13:40 UTC (permalink / raw)
To: Avinesh Kumar; +Cc: ltp
Hi Avinesh,
thanks for the cleanup, merged!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-07-08 13:41 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 9:11 [LTP] [PATCH 0/4] syscalls/cachestat01: minor improvements Avinesh Kumar via ltp
2026-07-08 9:11 ` [LTP] [PATCH 1/4] syscalls/cachestat01: Remove redundant memset() on cachestat buffer Avinesh Kumar via ltp
2026-07-08 10:21 ` [LTP] " linuxtestproject.agent
2026-07-08 9:11 ` [LTP] [PATCH 2/4] syscalls/cachestat01: Drop stray newline in tst_res() message Avinesh Kumar via ltp
2026-07-08 9:11 ` [LTP] [PATCH 3/4] syscalls/cachestat01: Add spaces around '<<' operator Avinesh Kumar via ltp
2026-07-08 9:11 ` [LTP] [PATCH 4/4] syscalls/cachestat01: Use SAFE_FSYNC() instead of fsync() Avinesh Kumar via ltp
2026-07-08 13:40 ` Petr Vorel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.