Re: [LTP] [PATCH v7] fanotify22.c: handle multiple asynchronous error events

Wei Gao via ltp
2026-03-28T00:44:50Z

On Fri, Mar 27, 2026 at 02:19:28PM +0000, Andrea Cervesato wrote:
> Hi Wei,
>
> we still have a problem with the patch. We are considering deterministic
> events, where one event comes after the other.
>
> consolidate_events() accepts events matching either ex->error or
> ex->error2:
>
> > + if (info->error != ex->error && (ex->error2 == 0 || info->error != ex->error2)) {
>
> but the first accepted event becomes the one passed to check_event().
> Since event delivery order is non-deterministic, the first event could
> have error == ESHUTDOWN (error2). check_error_event_info_error() then
> only checks against ex->error:
>
> > if (info_error->error != ex->error) {
> > tst_res(TFAIL, "Unexpected error code value (%d!=%d)",
> > info_error->error, ex->error);
>
> So it compares ESHUTDOWN against EFSCORRUPTED, doesn't match, and
> reports TFAIL.
>
> We need to change that into:
>
> if (info_error->error != ex->error &&
> (ex->error2 == 0 || info_error->error != ex->error2)) {
>
> Similar to the consolidate_events(), otherwise we will have a TFAIL when
> events don't arrive in the same order. Did you try to run patch with a high
> number of `-i` ? It should fails sometimes with the actual code.
I remember i have tested in openqa with -i1000 without error in early version such
as v4 or v5(The main logic not touched compared with v6/v7).

BTW: is this the final comments?
>
> Regards,
> --
> Andrea Cervesato
> SUSE QE Automation Engineer Linux
> andrea.cervesato@suse.com