public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 1/2] syscalls/pidfd_open01.c: Add check for close-on-exec flag
Date: Thu, 14 May 2020 17:43:53 +0800	[thread overview]
Message-ID: <5EBD12D9.70708@cn.fujitsu.com> (raw)
In-Reply-To: <20200514073701.GA9562@dell5510>

On 2020/5/14 15:37, Petr Vorel wrote:
> Hi Yang,
>
> one more note:
>
>>> As my pervious mail said, It is just a possible situation? for example:
>>> Upstream kernel introduces btrfs filesystem long long ago but the
>>> kernel of RHEL8 drops btrfs filesystem because of some reasons.
>> I guess filesystem changes are the most frequent. But as I said, I wouldn't mind
>> this implementation:
>> void fsopen_supported_by_kernel(void)
>> {
>> 	TEST(tst_syscall(__NR_fsopen, NULL, 0));
>> 	if (TST_RET != -1)
>> 		SAFE_CLOSE(TST_RET);
>> }
> BTW the same approach is used in include/lapi/openat2.h
>
> void openat2_supported_by_kernel(void)
> {
> 	if ((tst_kvercmp(5, 6, 0))<  0) {
> 		/* Check if the syscall is backported on an older kernel */
> 		TEST(syscall(__NR_openat2, -1, NULL, NULL, 0));
> 		if (TST_RET == -1&&  TST_ERR == ENOSYS)
> 			tst_brk(TCONF, "Test not supported on kernel version<  v5.6");
> 	}
> }
>
> and clone3_supported_by_kernel(). Both merged by Cyril.
>
> To be honest I like this approach, because 1) it defines when new syscall was
> backported
Hi Petr?

Hmm, the reason seems a little weak, it can be done by adding a 
comment(e.g. "the syscall is introduced since v5.6.0").

2) if there is really problem that some functionality was removed, we
> can always handle it. But IMHO that's going to be rare (btrfs removed in RHEL 8
> is IMHO because RHEL does not want to support it, but that would not happen for
> syscalls).

Without the rare situation, I also think tst_syscall() is enough to 
check the support of syscall.

>
> I'd also like to be consistent how we handle these new syscalls.
Agreed.

I also think if we can implement common func(e.g. 
syscall_supported_by_kernel()).

Best Regards,
Xiao Yang
>
> Kind regards,
> Petr
>
>
> .
>




  reply	other threads:[~2020-05-14  9:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13  1:26 [LTP] [PATCH v2 1/2] syscalls/pidfd_open01.c: Add check for close-on-exec flag Xiao Yang
2020-05-13  1:26 ` [LTP] [PATCH v2 2/2] syscalls/pidfd_open*.c: Drop .min_kver flag Xiao Yang
2020-05-13  5:55   ` Viresh Kumar
2020-05-13  6:03     ` Xiao Yang
2020-05-13  6:13       ` Viresh Kumar
2020-05-13  6:31         ` Xiao Yang
2020-05-13  6:39           ` Viresh Kumar
2020-05-13  2:28 ` [LTP] [PATCH v2 1/2] syscalls/pidfd_open01.c: Add check for close-on-exec flag Xiao Yang
2020-05-13  9:20   ` Petr Vorel
2020-05-13 10:21     ` Xiao Yang
2020-05-13 10:30       ` Petr Vorel
2020-05-14  7:37         ` Petr Vorel
2020-05-14  9:43           ` Xiao Yang [this message]
2020-05-14 14:14             ` Petr Vorel
2020-05-14 14:27               ` Xiao Yang
2020-05-13 12:34 ` Cyril Hrubis
2020-05-13 13:12   ` Xiao Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5EBD12D9.70708@cn.fujitsu.com \
    --to=yangx.jy@cn.fujitsu.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox