From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Wei Gao" <wegao@suse.com>
Cc: Jan Kara <jack@suse.cz>,
kernel test robot <oliver.sang@intel.com>,
ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v6] fanotify22.c: handle multiple asynchronous error events
Date: Fri, 27 Mar 2026 09:07:28 +0000 [thread overview]
Message-ID: <69c648d0.050a0220.2ca52b.c494@mx.google.com> (raw)
In-Reply-To: <20260327045536.7852-1-wegao@suse.com>
Hi Wei,
> Since the introduction of the asynchronous fserror reporting framework
> (kernel commit 81d2e13a57c9), fanotify22 has encountered sporadic failures
> due to the non-deterministic nature of event delivery and merging:
>
> 1) tcase3 failure: A race condition occurs when the test reads the
> notification fd between two events. uses a poll() and read() loop to wait
> until the expected.
This sentence is truncated at expected. Maybe the meaning was "Use a poll()
and read() loop to wait until the expected event".
> +
> + while (accumulated_count < tcase->error_count) {
> + if (poll(&pfd, 1, 5000) <= 0) {
> + tst_res(TFAIL, "%s: Timeout waiting for events", tcase->name);
> + goto out;
> + }
> +
> + if (read_len >= BUF_SIZE)
> + tst_brk(TBROK, "Event buffer full");
> +
> + char *current_pos = event_buf + read_len;
> + ssize_t ret = read(fd_notify, current_pos, BUF_SIZE - read_len);
> +
> + if (ret < 0) {
> + tst_brk(TBROK | TERRNO, "%s: read failed", tcase->name);
> + }
This is a bit weird. We have SAFE_READ() which is handling already the
read() syscalls errors, so we should use it. The reason why we are manually
handling the error is to show the tcase->name I guess. In this case, we
don't really need this: we usually have
tst_res(TINFO, "Test case: %s", tcase->name);
at the beginning of the do_test() function, so everything that comes later
will be related to it. At that point, also poll() TFAIL message should be
updated accordingly.
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-03-27 9:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 13:38 [LTP] [PATCH v1] fanotify22.c: handle multiple asynchronous error events Wei Gao via ltp
2026-03-05 9:36 ` Jan Kara
2026-03-05 14:36 ` Wei Gao via ltp
2026-03-05 15:50 ` Jan Kara
2026-03-06 4:50 ` Wei Gao via ltp
2026-03-06 12:24 ` Petr Vorel
2026-03-06 15:19 ` Jan Kara
2026-03-09 7:59 ` [LTP] [PATCH v2] " Wei Gao via ltp
2026-03-09 10:26 ` Andrea Cervesato via ltp
2026-03-09 11:29 ` Jan Kara
2026-03-18 6:46 ` [LTP] [PATCH v3] " Wei Gao via ltp
2026-03-18 18:18 ` Jan Kara
2026-03-24 11:55 ` Andrea Cervesato via ltp
2026-03-25 12:43 ` [LTP] [PATCH v4] " Wei Gao via ltp
2026-03-25 15:52 ` Jan Kara
2026-03-26 1:28 ` [LTP] [PATCH v5] " Wei Gao via ltp
2026-03-26 8:57 ` Jan Kara
2026-03-26 9:40 ` Andrea Cervesato via ltp
2026-03-27 4:55 ` [LTP] [PATCH v6] " Wei Gao via ltp
2026-03-27 9:07 ` Andrea Cervesato via ltp [this message]
2026-03-27 12:33 ` [LTP] [PATCH v7] " Wei Gao via ltp
2026-03-27 14:19 ` Andrea Cervesato via ltp
2026-03-28 0:44 ` Wei Gao via ltp
2026-03-30 7:17 ` Andrea Cervesato via ltp
2026-03-30 7:36 ` Jan Kara
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=69c648d0.050a0220.2ca52b.c494@mx.google.com \
--to=ltp@lists.linux.it \
--cc=andrea.cervesato@suse.com \
--cc=jack@suse.cz \
--cc=oliver.sang@intel.com \
--cc=wegao@suse.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 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.