* [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP
@ 2025-12-08 15:05 Petr Vorel
2025-12-08 15:05 ` [LTP] [PATCH 1/2] " Petr Vorel
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: Petr Vorel @ 2025-12-08 15:05 UTC (permalink / raw)
To: ltp; +Cc: Mingyu Li, Meng Yang
Hi Meng, Mingyu,
this is another approach for your patchset
https://lore.kernel.org/ltp/20251205031719.53914-1-simplemessager@163.com/
Could you please test it?
Kind regards,
Petr
Petr Vorel (2):
safe_keyctl: Skip with TCONF on EOPNOTSUPP
wqueue0*: Use SAFE_KEYCTL()
include/lapi/keyctl.h | 3 ++-
testcases/kernel/watchqueue/common.h | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH 1/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP
2025-12-08 15:05 [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP Petr Vorel
@ 2025-12-08 15:05 ` Petr Vorel
2025-12-09 19:48 ` Petr Vorel
2025-12-08 15:05 ` [LTP] [PATCH 2/2] wqueue0*: Use SAFE_KEYCTL() Petr Vorel
` (2 subsequent siblings)
3 siblings, 1 reply; 14+ messages in thread
From: Petr Vorel @ 2025-12-08 15:05 UTC (permalink / raw)
To: ltp; +Cc: Mingyu Li, Meng Yang
errno EOPNOTSUPP is likely a configuration issue, skip testing
with TCONF.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
include/lapi/keyctl.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/lapi/keyctl.h b/include/lapi/keyctl.h
index e08b8f1322..ab5c8a530f 100644
--- a/include/lapi/keyctl.h
+++ b/include/lapi/keyctl.h
@@ -209,10 +209,11 @@ static inline long safe_keyctl(const char *file, const int lineno,
{
long rval;
int failure = 0;
+ int res = errno == EOPNOTSUPP ? TCONF : TBROK | TERRNO;
rval = keyctl(cmd, arg2, arg3, arg4, arg5);
if (rval == -1) {
- tst_brk_(file, lineno, TBROK | TERRNO,
+ tst_brk_(file, lineno, res,
"keyctl(%d, %lu, %lu, %lu, %lu)",
cmd, arg2, arg3, arg4, arg5);
}
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [LTP] [PATCH 2/2] wqueue0*: Use SAFE_KEYCTL()
2025-12-08 15:05 [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP Petr Vorel
2025-12-08 15:05 ` [LTP] [PATCH 1/2] " Petr Vorel
@ 2025-12-08 15:05 ` Petr Vorel
2025-12-12 15:22 ` Petr Vorel
2025-12-09 12:29 ` [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP simplemessager
2025-12-09 12:37 ` [LTP] [PATCH 0/2] " simplemessager
3 siblings, 1 reply; 14+ messages in thread
From: Petr Vorel @ 2025-12-08 15:05 UTC (permalink / raw)
To: ltp; +Cc: Mingyu Li, Meng Yang
Using SAFE_KEYCTL() helps to TCONF on EOPNOTSUPP, which is a
configuration issue.
Reported-by: Meng Yang <yangm50@chinatelecom.cn>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
testcases/kernel/watchqueue/common.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/watchqueue/common.h b/testcases/kernel/watchqueue/common.h
index 92e8f079cd..0921dce9a6 100644
--- a/testcases/kernel/watchqueue/common.h
+++ b/testcases/kernel/watchqueue/common.h
@@ -85,8 +85,8 @@ static inline key_serial_t wqueue_add_key(int fd)
if (key == -1)
tst_brk(TBROK, "add_key error: %s", tst_strerrno(errno));
- keyctl(KEYCTL_WATCH_KEY, key, fd, 0x01);
- keyctl(KEYCTL_WATCH_KEY, KEY_SPEC_SESSION_KEYRING, fd, 0x02);
+ SAFE_KEYCTL(KEYCTL_WATCH_KEY, key, fd, 0x01, 0);
+ SAFE_KEYCTL(KEYCTL_WATCH_KEY, KEY_SPEC_SESSION_KEYRING, fd, 0x02, 0);
return key;
}
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP
2025-12-08 15:05 [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP Petr Vorel
2025-12-08 15:05 ` [LTP] [PATCH 1/2] " Petr Vorel
2025-12-08 15:05 ` [LTP] [PATCH 2/2] wqueue0*: Use SAFE_KEYCTL() Petr Vorel
@ 2025-12-09 12:29 ` simplemessager
2025-12-09 12:29 ` [LTP] [PATCH] " simplemessager
2025-12-09 12:37 ` [LTP] [PATCH 0/2] " simplemessager
3 siblings, 1 reply; 14+ messages in thread
From: simplemessager @ 2025-12-09 12:29 UTC (permalink / raw)
To: badmailer, ltp
Mingyu Li
>
>Kind regards,
>Petr
>
>Petr Vorel (2):
> safe_keyctl: Skip with TCONF on EOPNOTSUPP
> wqueue0*: Use SAFE_KEYCTL()
>
> include/lapi/keyctl.h | 3 ++-
> testcases/kernel/watchqueue/common.h | 4 ++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
>--
>2.51.0
>
>
>--
>Mailing list info: https://lists.linux.it/listinfo/ltp
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH] safe_keyctl: Skip with TCONF on EOPNOTSUPP
2025-12-09 12:29 ` [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP simplemessager
@ 2025-12-09 12:29 ` simplemessager
0 siblings, 0 replies; 14+ messages in thread
From: simplemessager @ 2025-12-09 12:29 UTC (permalink / raw)
To: badmailer, ltp
From: Petr Vorel <pvorel@suse.cz>
errno EOPNOTSUPP is likely a configuration issue, skip testing
with TCONF.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Mingyu Li <limy83@chinatelecom.cn>
---
include/lapi/keyctl.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/lapi/keyctl.h b/include/lapi/keyctl.h
index e08b8f132..eac9e2609 100644
--- a/include/lapi/keyctl.h
+++ b/include/lapi/keyctl.h
@@ -212,7 +212,8 @@ static inline long safe_keyctl(const char *file, const int lineno,
rval = keyctl(cmd, arg2, arg3, arg4, arg5);
if (rval == -1) {
- tst_brk_(file, lineno, TBROK | TERRNO,
+ tst_brk_(file, lineno,
+ errno == EOPNOTSUPP ? TCONF : TBROK | TERRNO,
"keyctl(%d, %lu, %lu, %lu, %lu)",
cmd, arg2, arg3, arg4, arg5);
}
--
2.47.2
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP
2025-12-08 15:05 [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP Petr Vorel
` (2 preceding siblings ...)
2025-12-09 12:29 ` [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP simplemessager
@ 2025-12-09 12:37 ` simplemessager
2025-12-09 12:37 ` [LTP] [PATCH] " simplemessager
2025-12-09 19:50 ` [LTP] [PATCH 0/2] " Petr Vorel
3 siblings, 2 replies; 14+ messages in thread
From: simplemessager @ 2025-12-09 12:37 UTC (permalink / raw)
To: pvorel, ltp
>At 2025-12-08 23:05:40, "Petr Vorel" <pvorel@suse.cz> wrote:
>Hi Meng, Mingyu,
>
>this is another approach for your patchset
>https://lore.kernel.org/ltp/20251205031719.53914-1-simplemessager@163.com/
>
>Could you please test it?
Thanks for your suggestion, it's better when we using the SAFE_KEYCTL
interface.
I have already tested those two patches. It always return TBRK as res
variable is not suitable for our purpose, so I modified the first patch.
>
>Kind regards,
>Petr
>
>Petr Vorel (2):
> safe_keyctl: Skip with TCONF on EOPNOTSUPP
> wqueue0*: Use SAFE_KEYCTL()
>
> include/lapi/keyctl.h | 3 ++-
> testcases/kernel/watchqueue/common.h | 4 ++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
>--
>2.51.0
>
>
>--
>Mailing list info: https://lists.linux.it/listinfo/ltp
And sorry for previous broken mail, I spent sometime to figure out how
to reply this mail properly.
Mingyu Li
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH] safe_keyctl: Skip with TCONF on EOPNOTSUPP
2025-12-09 12:37 ` [LTP] [PATCH 0/2] " simplemessager
@ 2025-12-09 12:37 ` simplemessager
2025-12-09 19:53 ` Petr Vorel
2025-12-09 19:50 ` [LTP] [PATCH 0/2] " Petr Vorel
1 sibling, 1 reply; 14+ messages in thread
From: simplemessager @ 2025-12-09 12:37 UTC (permalink / raw)
To: pvorel, ltp
From: Petr Vorel <pvorel@suse.cz>
errno EOPNOTSUPP is likely a configuration issue, skip testing
with TCONF.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Mingyu Li <limy83@chinatelecom.cn>
---
include/lapi/keyctl.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/lapi/keyctl.h b/include/lapi/keyctl.h
index e08b8f132..eac9e2609 100644
--- a/include/lapi/keyctl.h
+++ b/include/lapi/keyctl.h
@@ -212,7 +212,8 @@ static inline long safe_keyctl(const char *file, const int lineno,
rval = keyctl(cmd, arg2, arg3, arg4, arg5);
if (rval == -1) {
- tst_brk_(file, lineno, TBROK | TERRNO,
+ tst_brk_(file, lineno,
+ errno == EOPNOTSUPP ? TCONF : TBROK | TERRNO,
"keyctl(%d, %lu, %lu, %lu, %lu)",
cmd, arg2, arg3, arg4, arg5);
}
--
2.47.2
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [LTP] [PATCH 1/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP
2025-12-08 15:05 ` [LTP] [PATCH 1/2] " Petr Vorel
@ 2025-12-09 19:48 ` Petr Vorel
0 siblings, 0 replies; 14+ messages in thread
From: Petr Vorel @ 2025-12-09 19:48 UTC (permalink / raw)
To: ltp; +Cc: Meng Yang, Mingyu Li
...
> +++ b/include/lapi/keyctl.h
> @@ -209,10 +209,11 @@ static inline long safe_keyctl(const char *file, const int lineno,
> {
> long rval;
> int failure = 0;
> + int res = errno == EOPNOTSUPP ? TCONF : TBROK | TERRNO;
Obviously set variable before calling keyctl() is wrong,
as Mingyu Li reported
https://lore.kernel.org/ltp/20251209124041.216542-1-simplemessager@163.com/
Therefore his patch which does not store value before use should be used:
https://patchwork.ozlabs.org/project/ltp/patch/20251209122937.212641-2-simplemessager@163.com/
https://lore.kernel.org/ltp/20251209124041.216542-2-simplemessager@163.com/
Kind regards,
Petr
> rval = keyctl(cmd, arg2, arg3, arg4, arg5);
> if (rval == -1) {
> - tst_brk_(file, lineno, TBROK | TERRNO,
> + tst_brk_(file, lineno, res,
> "keyctl(%d, %lu, %lu, %lu, %lu)",
> cmd, arg2, arg3, arg4, arg5);
> }
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP
2025-12-09 12:37 ` [LTP] [PATCH 0/2] " simplemessager
2025-12-09 12:37 ` [LTP] [PATCH] " simplemessager
@ 2025-12-09 19:50 ` Petr Vorel
1 sibling, 0 replies; 14+ messages in thread
From: Petr Vorel @ 2025-12-09 19:50 UTC (permalink / raw)
To: simplemessager; +Cc: ltp
> >At 2025-12-08 23:05:40, "Petr Vorel" <pvorel@suse.cz> wrote:
> >Hi Meng, Mingyu,
> >this is another approach for your patchset
> >https://lore.kernel.org/ltp/20251205031719.53914-1-simplemessager@163.com/
> >Could you please test it?
> Thanks for your suggestion, it's better when we using the SAFE_KEYCTL
> interface.
> I have already tested those two patches. It always return TBRK as res
> variable is not suitable for our purpose, so I modified the first patch.
Good catch, thanks!
> >Kind regards,
> >Petr
> >Petr Vorel (2):
> > safe_keyctl: Skip with TCONF on EOPNOTSUPP
> > wqueue0*: Use SAFE_KEYCTL()
> > include/lapi/keyctl.h | 3 ++-
> > testcases/kernel/watchqueue/common.h | 4 ++--
> > 2 files changed, 4 insertions(+), 3 deletions(-)
> >--
> >2.51.0
> >--
> >Mailing list info: https://lists.linux.it/listinfo/ltp
> And sorry for previous broken mail, I spent sometime to figure out how
> to reply this mail properly.
Don't worry, I've cleanup the patchwork state by setting the state of the first
patch as superseded. The one send later should be used for a discussion /
reviews.
https://patchwork.ozlabs.org/project/ltp/patch/20251209124041.216542-2-simplemessager@163.com/
Kind regards,
Petr
> Mingyu Li
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [LTP] [PATCH] safe_keyctl: Skip with TCONF on EOPNOTSUPP
2025-12-09 12:37 ` [LTP] [PATCH] " simplemessager
@ 2025-12-09 19:53 ` Petr Vorel
2025-12-11 8:11 ` simplemessager
0 siblings, 1 reply; 14+ messages in thread
From: Petr Vorel @ 2025-12-09 19:53 UTC (permalink / raw)
To: simplemessager; +Cc: ltp
Hi all,
Reviewed-by: Petr Vorel <pvorel@suse.cz>
This replaces my previous attempt:
https://patchwork.ozlabs.org/project/ltp/patch/20251208150542.704006-2-pvorel@suse.cz/
https://lore.kernel.org/ltp/20251208150542.704006-2-pvorel@suse.cz/
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [LTP] [PATCH] safe_keyctl: Skip with TCONF on EOPNOTSUPP
2025-12-09 19:53 ` Petr Vorel
@ 2025-12-11 8:11 ` simplemessager
2025-12-11 8:11 ` [LTP] [PATCH 1/1] " simplemessager
0 siblings, 1 reply; 14+ messages in thread
From: simplemessager @ 2025-12-11 8:11 UTC (permalink / raw)
To: pvorel, ltp
Thanks for your review.
Mingyu Li
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 14+ messages in thread
* [LTP] [PATCH 1/1] safe_keyctl: Skip with TCONF on EOPNOTSUPP
2025-12-11 8:11 ` simplemessager
@ 2025-12-11 8:11 ` simplemessager
2025-12-12 15:21 ` Petr Vorel
0 siblings, 1 reply; 14+ messages in thread
From: simplemessager @ 2025-12-11 8:11 UTC (permalink / raw)
To: pvorel, ltp
From: Petr Vorel <pvorel@suse.cz>
errno EOPNOTSUPP is likely a configuration issue, skip testing
with TCONF.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Mingyu Li <limy83@chinatelecom.cn>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
---
include/lapi/keyctl.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/lapi/keyctl.h b/include/lapi/keyctl.h
index e08b8f132..eac9e2609 100644
--- a/include/lapi/keyctl.h
+++ b/include/lapi/keyctl.h
@@ -212,7 +212,8 @@ static inline long safe_keyctl(const char *file, const int lineno,
rval = keyctl(cmd, arg2, arg3, arg4, arg5);
if (rval == -1) {
- tst_brk_(file, lineno, TBROK | TERRNO,
+ tst_brk_(file, lineno,
+ errno == EOPNOTSUPP ? TCONF : TBROK | TERRNO,
"keyctl(%d, %lu, %lu, %lu, %lu)",
cmd, arg2, arg3, arg4, arg5);
}
--
2.47.2
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [LTP] [PATCH 1/1] safe_keyctl: Skip with TCONF on EOPNOTSUPP
2025-12-11 8:11 ` [LTP] [PATCH 1/1] " simplemessager
@ 2025-12-12 15:21 ` Petr Vorel
0 siblings, 0 replies; 14+ messages in thread
From: Petr Vorel @ 2025-12-12 15:21 UTC (permalink / raw)
To: simplemessager; +Cc: ltp
> From: Petr Vorel <pvorel@suse.cz>
> errno EOPNOTSUPP is likely a configuration issue, skip testing
> with TCONF.
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> Signed-off-by: Mingyu Li <limy83@chinatelecom.cn>
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> ---
> include/lapi/keyctl.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> diff --git a/include/lapi/keyctl.h b/include/lapi/keyctl.h
> index e08b8f132..eac9e2609 100644
> --- a/include/lapi/keyctl.h
> +++ b/include/lapi/keyctl.h
> @@ -212,7 +212,8 @@ static inline long safe_keyctl(const char *file, const int lineno,
> rval = keyctl(cmd, arg2, arg3, arg4, arg5);
> if (rval == -1) {
> - tst_brk_(file, lineno, TBROK | TERRNO,
> + tst_brk_(file, lineno,
> + errno == EOPNOTSUPP ? TCONF : TBROK | TERRNO,
In the end, thinking about it twice I merged version which always prints TERRNO,
because we don't have any special explanation for TCONF, therefore the only
explanation is the errno itself:
(errno == EOPNOTSUPP ? TCONF : TBROK) | TERRNO,
Merged, with your Reviewed-by: and Co-developed-by:. Thanks!
Kind regards,
Petr
> "keyctl(%d, %lu, %lu, %lu, %lu)",
> cmd, arg2, arg3, arg4, arg5);
> }
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [LTP] [PATCH 2/2] wqueue0*: Use SAFE_KEYCTL()
2025-12-08 15:05 ` [LTP] [PATCH 2/2] wqueue0*: Use SAFE_KEYCTL() Petr Vorel
@ 2025-12-12 15:22 ` Petr Vorel
0 siblings, 0 replies; 14+ messages in thread
From: Petr Vorel @ 2025-12-12 15:22 UTC (permalink / raw)
To: ltp; +Cc: Meng Yang, Mingyu Li
> Using SAFE_KEYCTL() helps to TCONF on EOPNOTSUPP, which is a
> configuration issue.
FYI merged this patch.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2025-12-12 15:23 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08 15:05 [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP Petr Vorel
2025-12-08 15:05 ` [LTP] [PATCH 1/2] " Petr Vorel
2025-12-09 19:48 ` Petr Vorel
2025-12-08 15:05 ` [LTP] [PATCH 2/2] wqueue0*: Use SAFE_KEYCTL() Petr Vorel
2025-12-12 15:22 ` Petr Vorel
2025-12-09 12:29 ` [LTP] [PATCH 0/2] safe_keyctl: Skip with TCONF on EOPNOTSUPP simplemessager
2025-12-09 12:29 ` [LTP] [PATCH] " simplemessager
2025-12-09 12:37 ` [LTP] [PATCH 0/2] " simplemessager
2025-12-09 12:37 ` [LTP] [PATCH] " simplemessager
2025-12-09 19:53 ` Petr Vorel
2025-12-11 8:11 ` simplemessager
2025-12-11 8:11 ` [LTP] [PATCH 1/1] " simplemessager
2025-12-12 15:21 ` Petr Vorel
2025-12-09 19:50 ` [LTP] [PATCH 0/2] " Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox