safe_keyctl: Skip with TCONF on EOPNOTSUPP
cover safe_keyctl: Skip with TCONF on EOPNOTSUPP
Hi Meng, Mingyu,
this is another approach for your patchset
https://lore.kernel.org/ltp/[email protected]/
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(-)
Signature · 5 lines
2.51.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 1/2 safe_keyctl: Skip with TCONF on EOPNOTSUPP
errno EOPNOTSUPP is likely a configuration issue, skip testing with TCONF.
--- include/lapi/keyctl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/lapi/keyctl.h +2 -1
@@ -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); }
Signature · 5 lines
2.51.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
...
include/lapi/keyctl.h static inline long safe_keyctl(const char *file, const int lineno, · line 212
Quoted 6 lines
+++
b/include/lapi/keyctl.hinclude/lapi/keyctl.h +1
-0@@ -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/[email protected]/
Therefore his patch which does not store value before use should be used:
https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/
https://lore.kernel.org/ltp/[email protected]/
Kind regards,
Petr
Quoted 7 lines
include/lapi/keyctl.h +1
-1rval =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); }
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 2/2 wqueue0*: Use SAFE_KEYCTL()
In reply to Petr VorelUsing SAFE_KEYCTL() helps to TCONF on EOPNOTSUPP, which is a configuration issue.
--- testcases/kernel/watchqueue/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/watchqueue/common.h +2 -2
@@ -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; }
Signature · 5 lines
2.51.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 2/2] wqueue0*: Use SAFE_KEYCTL()
Quoted 2 lines
Using
SAFE_KEYCTL()helps to TCONF on EOPNOTSUPP, which is a configuration issue.
FYI merged this patch.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Mingyu Li
Quoted 18 lines
Kind regards,
PetrPetr Vorel (2):
safe_keyctl: Skip with TCONF on EOPNOTSUPP
wqueue0*: UseSAFE_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
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 1/1 safe_keyctl: Skip with TCONF on EOPNOTSUPP
From: Petr Vorel <[email protected]>
errno EOPNOTSUPP is likely a configuration issue, skip testing with TCONF.
--- include/lapi/keyctl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/lapi/keyctl.h +2 -1
@@ -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); }
Signature · 5 lines
2.47.2 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 7 lines
At 2025-12-08 23:05:40, "Petr Vorel" <[email protected]> wrote:
Hi Meng, Mingyu,this is another approach for your patchset
https://lore.kernel.org/ltp/[email protected]/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.
Quoted 10 lines
Kind regards,
PetrPetr Vorel (2):
safe_keyctl: Skip with TCONF on EOPNOTSUPP
wqueue0*: UseSAFE_KEYCTL()
include/lapi/keyctl.h| 3 ++-testcases/kernel/watchqueue/common.h| 4 ++--
Quoted 8 lines
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
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 1/1 safe_keyctl: Skip with TCONF on EOPNOTSUPP
From: Petr Vorel <[email protected]>
errno EOPNOTSUPP is likely a configuration issue, skip testing with TCONF.
--- include/lapi/keyctl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/lapi/keyctl.h +2 -1
@@ -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); }
Signature · 5 lines
2.47.2 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi all,
This replaces my previous attempt:
https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/
https://lore.kernel.org/ltp/[email protected]/
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Thanks for your review.
Mingyu Li
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 1/1 safe_keyctl: Skip with TCONF on EOPNOTSUPP
From: Petr Vorel <[email protected]>
errno EOPNOTSUPP is likely a configuration issue, skip testing with TCONF.
--- include/lapi/keyctl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/lapi/keyctl.h +2 -1
@@ -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); }
Signature · 5 lines
2.47.2 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 17 lines
From: Petr Vorel <[email protected]>
errno EOPNOTSUPP is likely a configuration issue, skip testing with TCONF.
Signed-off-by Petr Vorel <[email protected]>Signed-off-by Mingyu Li <[email protected]>Reviewed-by Petr Vorel <[email protected]>--- include/lapi/keyctl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)include/lapi/keyctl.h +0
-0
include/lapi/keyctl.h static inline long safe_keyctl(const char *file, const int lineno, · line 216
Quoted 6 lines
include/lapi/keyctl.h +2
-1@@ -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
Quoted 3 lines
include/lapi/keyctl.h +0
-0"keyctl(%d, %lu, %lu, %lu, %lu)" , cmd, arg2, arg3, arg4, arg5); }
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 11 lines
Quoted 7 lines
At 2025-12-08 23:05:40, "Petr Vorel" <[email protected]> wrote:
Hi Meng, Mingyu,this is another approach for your patchset
https://lore.kernel.org/ltp/[email protected]/Could you please test it?
Thanks for your suggestion, it's better when we using the
SAFE_KEYCTLinterface.
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!
Quoted 15 lines
Quoted 13 lines
Kind regards,
PetrPetr Vorel (2):
safe_keyctl: Skip with TCONF on EOPNOTSUPP
wqueue0*: UseSAFE_KEYCTL()
include/lapi/keyctl.h| 3 ++-testcases/kernel/watchqueue/common.h| 4 ++--2 files changed, 4 insertions(+), 3 deletions(-)--
2.51.0
Quoted 5 lines
Quoted 2 lines
--
Mailing list info: https://lists.linux.it/listinfo/ltpAnd 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/[email protected]/
Kind regards,
Petr
Quoted 1 line
Mingyu Li
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp