[LTP] [PATCH 3/5] syscalls/fanotify09: Read variable length events

Petr Vorel pvorel@suse.cz
Mon Dec 7 15:22:40 CET 2020


Hi Amir,
> > > In preparation of testing events with filename info, teach the
> > > how to read variable length events and parse the name info.

> > This commit broke umount() on old kernels. (LTP lib doing multiple attempts is
> > useless here). Not sure what exactly is being used, it's not by staing in
> > mounted directory. Any idea how to fix it?


> --- a/testcases/kernel/syscalls/fanotify/fanotify09.c
> +++ b/testcases/kernel/syscalls/fanotify/fanotify09.c
> @@ -265,6 +265,7 @@ static void test_fanotify(unsigned int n)
>         for (i = 1; i < NUM_GROUPS; i++) {
>                 ret = read(fd_notify[i], event_buf, FAN_EVENT_METADATA_LEN);
>                 if (ret > 0) {
> +                       event = (struct fanotify_event_metadata *)event_buf;
>                         event_res(TFAIL, i, event, "");
>                         if (event->fd != FAN_NOFD)
>                                 SAFE_CLOSE(event->fd);

> The fix exists in the following patch, therefore I did not notice the
> mid series regression.
While this is valid to be added in this commit and I'll add it, it does not fix
our solution. I might not be clear: since this commit it's broken.
Thus any other tip?

Kind regards,
Petr

> Thanks,
> Amir.


More information about the ltp mailing list