($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Subramanya Swamy <subramanya.swamy.linux@gmail.com>
To: ltp@lists.linux.it
Cc: Subramanya Swamy <subramanya.swamy.linux@gmail.com>
Subject: [LTP] [PATCH v1] read_all :catch alignment faults while reading sys entries seen in commit :bc21785b7336619fb6a67f1fff5afdaf229acc
Date: Wed,  3 Jan 2024 07:17:26 -0500	[thread overview]
Message-ID: <20240103121726.1854-1-subramanya.swamy.linux@gmail.com> (raw)

Signed-off-by: Subramanya Swamy <subramanya.swamy.linux@gmail.com>
---
 testcases/kernel/fs/read_all/read_all.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c
index 266678ea7..95e3ca275 100644
--- a/testcases/kernel/fs/read_all/read_all.c
+++ b/testcases/kernel/fs/read_all/read_all.c
@@ -249,6 +249,20 @@ static void read_test(const int worker, const char *const path)
 	}
 
 	worker_heartbeat(worker);
+	/*
+	 * This could catch any alignment faults while reading sys entries
+	 * seen in commit :bc21785b7336619fb6a67f1fff5afdaf229acc so reading 1024 bytes
+	 * in chunks of 8 bytes 128 times
+	 */
+	char check_buf[7];
+	unsigned int i;
+
+	for (i = 0; i < 128; i++) {
+		count = read(fd, check_buf, sizeof(check_buf));
+		if (count == 0 || count < 0)
+			break;
+	}
+
 	count = read(fd, buf, sizeof(buf) - 1);
 	elapsed = worker_elapsed(worker);
 
@@ -713,5 +727,5 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.test_all = run,
 	.forks_child = 1,
-	.max_runtime = 100,
+	.max_runtime = 200,
 };
-- 
2.39.3


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

             reply	other threads:[~2024-01-03 12:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03 12:17 Subramanya Swamy [this message]
2024-01-03 12:49 ` [LTP] [PATCH v1] read_all :catch alignment faults while reading sys entries seen in commit :bc21785b7336619fb6a67f1fff5afdaf229acc Cyril Hrubis
2024-01-03 13:42   ` Subramanya
2024-01-03 15:13     ` Cyril Hrubis
2024-01-07 10:16       ` Subramanya Swamy
2024-01-15 13:34         ` [LTP] [PATCH v3] read_all :catch alignment faults while reading sys entries seen in commit :1bbc21785b7336619fb6a67f1fff5afdaf229acc Subramanya Swamy
2024-04-19 13:39           ` Cyril Hrubis

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=20240103121726.1854-1-subramanya.swamy.linux@gmail.com \
    --to=subramanya.swamy.linux@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).