[LTP] [PATCH v3 2/2] fanotify14: Improve check for unsupported init flags

Petr Vorel pvorel@suse.cz
Tue Oct 24 21:19:06 CEST 2023


...
> > >>   static int pipes[2] = {-1, -1};
> > >>   static int fanotify_fd;
> > >> -static int fan_report_target_fid_unsupported;
> > >>   static int ignore_mark_unsupported;
> > >> +static unsigned int supported_init_flags;

> > >>   struct test_case_flags_t {
> > >>          unsigned long long flags;
> > >> @@ -246,9 +246,8 @@ static void do_test(unsigned int number)
> > >>          tst_res(TINFO, "Test case %d: fanotify_init(%s, O_RDONLY)", number,
> > >>                  tc->init.desc);

> > >> -       if (fan_report_target_fid_unsupported && tc->init.flags & FAN_REPORT_TARGET_FID) {
> > >> -               FANOTIFY_INIT_FLAGS_ERR_MSG(FAN_REPORT_TARGET_FID,
> > >> -                                           fan_report_target_fid_unsupported);
> > >> +       if (tc->init.flags & ~supported_init_flags) {
> > >> +               tst_res(TCONF, "Unsupported init flags"

> > > suggest to preserve the information printed by
> > > FANOTIFY_INIT_FLAGS_ERR_MSG, you can use tc->init.desc
> > > the for the flag name string.

> > tc->init.desc gets printed by the TINFO message at the start of the
> > patch chunk. The return value from fanotify_init_flags_supported_on_fs()
> > is not preserved anywhere by the new fanotify_get_supported_init_flags()
> > helper function so I have nothing to pass as the second argument of
> > FANOTIFY_INIT_FLAGS_ERR_MSG().


> OK.

Amir, thanks for your ack of this final issue. I merged the patchset.

Kind regards,
Petr

> Thanks,
> Amir.


More information about the ltp mailing list