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 v3] fanotify22.c: handle multiple asynchronous error events
Date: Tue, 24 Mar 2026 11:55:43 +0000 [thread overview]
Message-ID: <69c27bc0.df0a0220.1f9b07.91b3@mx.google.com> (raw)
In-Reply-To: <20260318064630.1604-1-wegao@suse.com>
Hi Wei,
there are still a few things to achieve before merge. Hoefully the next one
will be merged since we have Jan approval already.
> v2->v3:
> - Replaced usleep() with poll() loop
> - Added secondary error check support (error2)
This can't be added to the commit message.
> +
> + if (!info) {
> + tst_res(TFAIL, "%s: Event [%d] missing error info",
> + ex->name, event_num);
> + continue;
> + }
> +
> + if (info->error != ex->error && (ex->error2 == 0 || info->error != ex->error2)) {
> + tst_res(TFAIL, "%s: Event [%d] unexpected errno (%d)",
> + ex->name, event_num, info->error);
> + }
> +
> + if (info) {
We are already having if (!info) {.. continue; } so we don't need this.
> + pfd.fd = fd_notify;
> + pfd.events = POLLIN;
> +
> + while (accumulated_count < tcase->error_count) {
> + if (poll(&pfd, 1, 5000) <= 0) {
> + tst_res(TFAIL, "%s: Timeout waiting for events", tcase->name);
> + goto out;
> + }
> +
> + char *current_pos = event_buf + read_len;
> + int ret = read(fd_notify, current_pos, BUF_SIZE - read_len);
> +
> + if (ret < 0) {
> + tst_res(TFAIL, "%s: read failed: %s", tcase->name, strerror(errno));
> + goto out;
> + }
> +
> + struct fanotify_event_metadata *m =
> + (struct fanotify_event_metadata *)current_pos;
> + while (FAN_EVENT_OK(m, ret)) {
> + read_len += ret;
This should be moved out of the while() loop, otherwise we will grow the
read_len for multiple event.
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-24 11:56 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 [this message]
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
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=69c27bc0.df0a0220.1f9b07.91b3@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox