[LTP] [PATCH] close_range: check for kernel support below 5.9

Petr Vorel pvorel@suse.cz
Thu Feb 2 09:20:04 CET 2023


> On Thu, Feb 2, 2023 at 8:50 AM Petr Vorel <pvorel@suse.cz> wrote:

> > Hi Edward,

> > > Hi Petr,

> > > > > +++ b/include/lapi/close_range.h
> > > > > @@ -25,4 +25,17 @@ static inline int close_range(unsigned int fd, unsigned int max_fd,
> > > > >       return tst_syscall(__NR_close_range, fd, max_fd, flags);
> > > > >  }
> > > > >  # endif
> > > > > +
> > > > > +static inline void close_range_supported_by_kernel(void)
> > > > > +{
> > > > > +     long ret;
> > > > > +
> > > > > +     if ((tst_kvercmp(5, 9, 0)) < 0) {
> > > > > +             /* Check if the syscall is backported on an older kernel */
> > > > BTW what particular use case this fixed? Is it backported to some android
> > > > kernel? Or to some enterprise distro? Because I don't think kernel stable trees
> > > > accept new functionality, just fixes.

> > > Oops, should I use .min_kver instead?  It isn't backported on Android;
> > > I just wasn't sure what the right approach was.

> > Actually, looking into SLES kernel sources, we backported close_range() to SLES
> > 15-SP3 (bsc#1179090), which was 5.3.18 based. Thus you actually did good work :).

> > @Li, @Jan out of curiosity, was this backported to RHEL kernel as well?
> > It'd be useful to note that (one day we will be able to remove it once kernels
> > which backported are EOL).

> Yes, it's present in 8.4 since kernel-4.18.0-290.el8.

Jan, thanks a lot!

@Edward we have Hackweek at SUSE, I'll merge this on Monday,
noting the reason why to keep this instead simple .min_kver.

Kind regards,
Petr

> > Kind regards,
> > Petr

> > > Thanks,
> > > Edward




More information about the ltp mailing list