[LTP] [PATCH v2 2/3] Add fanotify_get_supported_init_flags() helper function
Petr Vorel
pvorel@suse.cz
Tue Oct 25 11:41:49 CEST 2022
> On 24. 10. 22 19:03, Petr Vorel wrote:
> > > The kernel UAPI is not very consistent about ENOTSUP vs. EINVAL
> > > renameat(2), unlink(2), link(2) and other return EINVAL for unsupported flags
> > > fallocate(2), ioctl(2) and others return ENOTSUP for unsupported commands.
> > > It's not a clear cut, but ENOTSUP is generally for unsupported fs methods,
> > > not for unsupported options.
> > thanks for info, I didn't know that. Otherwise Martin's note to use ENOTSUP
> > would help.
> I was not suggesting to change the kernel API, that's not a reasonable
> option at this point. I was just pointing out that the API design limits our
> options how to write reliable tests.
Sure, that was my suggestion. I meant it more as future improvement than to
solution to our problem, but I wasn't sure myself whether it be a good way.
It just remind me a different case, where errno was changed by accident and
kept that way (fix [1] was not accepted, instead the change was backported to
all live stable/LTS so that errno is at least consistent).
I also wonder whether real users of the API (not just test writers) would
appreciate to distinguish between these two cases. But anyway, I understand that
there would have to be a strong need for it to be reason to change, thus not
acceptable.
Kind regards,
Petr
[1] https://lore.kernel.org/netdev/20170630073448.GA9546@unicorn.suse.cz/
More information about the ltp
mailing list