All of lore.kernel.org
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] fanotify22.c: handle multiple asynchronous error events
Date: Wed, 29 Apr 2026 14:51:32 +0000	[thread overview]
Message-ID: <20260429145132.4008-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260331111857.10995-1-wegao@suse.com>

Hi Wei,

On 2026-03-31, Wei Gao <wegao@suse.com> wrote:
> fanotify22.c: handle multiple asynchronous error events

> Reported-by: kernel test robot <oliver.sang@intel.com>
> Closes: https://lore.kernel.org/oe-lkp/202602042124.87bd00e3-lkp@intel.com
> Signed-off-by: Wei Gao <wegao@suse.com>

This fixes a known sporadic failure; please add a Fixes: tag referencing
the LTP commit that introduced fanotify22.

> +	for (metadata = (struct fanotify_event_metadata *)buf;
> +			FAN_EVENT_OK(metadata, len);
> +			metadata = FAN_EVENT_NEXT(metadata, len)) {
> +
> +		event_num++;
> +		struct fanotify_event_info_error *info = get_event_info_error(metadata);

Declaration after statement. Move `info` to the top of the for-loop block.
Same issue with `current_pos`, `ret`, and `m` inside the while loop in
do_test(). Kernel coding style requires declarations at the top of each block.

> +		if (info->error != ex->error && (ex->error2 == 0 || info->error != ex->error2)) {
> +			...
> +			continue;
> +		}
> +
> +		if (!first) {
> +			first = metadata;
> +			first_info = info;
> +		}

Logic bug: `first` is set to the first valid event in buffer order, which
may be the error2 (ESHUTDOWN) event with null_fid. check_event() then
validates that event's FID against ex->fid (bad_file_fid) and fails.
Set `first` only when `info->error == ex->error` so the event with the
expected FID is always selected.

---
Note:

Our agent completed the review of the patch.

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

  reply	other threads:[~2026-04-29 14:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29  1:27 [LTP] [PATCH v1] io_submit04: Add test case for RWF_NOWAIT flag Wei Gao via ltp
2024-02-06 15:59 ` Petr Vorel
2025-10-22  2:05 ` [LTP] [PATCH v2] " Wei Gao via ltp
2025-12-18 13:21   ` Andrea Cervesato via ltp
2025-12-24  8:49   ` [LTP] [PATCH v3] " Wei Gao via ltp
2026-01-05 12:53     ` Andrea Cervesato via ltp
2026-01-06  6:26       ` Wei Gao via ltp
2026-01-06  8:39         ` Andrea Cervesato via ltp
2026-01-06  8:39         ` Petr Vorel
2026-01-07  8:53           ` Jan Stancek via ltp
2026-01-07  6:10     ` [LTP] [PATCH v4] " Wei Gao via ltp
2026-02-18 12:21       ` Andrea Cervesato via ltp
2026-03-05  4:41         ` Wei Gao via ltp
2026-03-17  7:43       ` [LTP] [PATCH v5] " Wei Gao via ltp
2026-03-17  9:54         ` Andrea Cervesato via ltp
2026-03-17 11:46         ` [LTP] [PATCH v6] " Wei Gao via ltp
2026-03-20 12:54           ` Andrea Cervesato via ltp
2026-03-27 18:17           ` Petr Vorel
2026-03-30  8:08             ` Wei Gao via ltp
2026-04-04  1:00             ` Wei Gao via ltp
2026-03-31 11:18           ` [LTP] [PATCH v7] fanotify22.c: handle multiple asynchronous error events Wei Gao via ltp
2026-04-29 14:51             ` linuxtestproject.agent [this message]
2026-05-07  2:58               ` [LTP] " Wei Gao via ltp
2026-05-07  2:53             ` [LTP] [PATCH v8] " Wei Gao via ltp
2026-05-07  6:18               ` [LTP] " linuxtestproject.agent
2026-05-07  7:37               ` [LTP] [PATCH v8] " Andrea Cervesato via ltp
2026-05-11 11:30               ` Jan Kara
2026-05-13 10:33               ` Petr Vorel
2026-04-04  1:13           ` [LTP] [PATCH v7] io_submit04: Add test case for RWF_NOWAIT flag Wei Gao via ltp
2026-04-08 15:11             ` Cyril Hrubis
2026-04-09  2:26               ` Wei Gao via ltp
2026-04-09  8:03                 ` Cyril Hrubis
2026-04-09 13:45                   ` 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=20260429145132.4008-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=ltp@lists.linux.it \
    --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.