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

Petr Vorel pvorel@suse.cz
Mon Oct 23 15:35:21 CEST 2023


Hi all,

...
> > > -       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().

You were faster than me. I don't know if it's worth to do mapping with function
similar to *tst_strerrno() in lib/errnos.h and print info about unsupported flag
(as string) in fanotify_get_supported_init_flags()).

BTW original error message does not print problematic flag in init (e.g.
FAN_REPORT_DFID_NAME_TARGET), but the corresponding one in the test
(FAN_REPORT_DFID_NAME_TARGET).

Kind regards,
Petr


More information about the ltp mailing list