* [LTP] [PATCH] syscalls/bind03: fix ret code behavior for v4.4 backport
@ 2018-11-07 13:38 Rafael David Tinoco
2018-11-20 15:20 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Rafael David Tinoco @ 2018-11-07 13:38 UTC (permalink / raw)
To: ltp
Recently added test bind03 has a corner case for bind(2). Because
mainline patch 0fb44559ffd6 ("af_unix: move unix_mknod() out of
bindlock") got backported to kernel v4.4 as commit 0492a033fb71, the
corner case must be adapted to correct running kernel version.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: Petr Vorel <pvorel@suse.cz>
Link: https://bugs.linaro.org/show_bug.cgi?id=4042
Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org>
---
testcases/kernel/syscalls/bind/bind03.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/testcases/kernel/syscalls/bind/bind03.c b/testcases/kernel/syscalls/bind/bind03.c
index 955a69dd2..f35e4786f 100644
--- a/testcases/kernel/syscalls/bind/bind03.c
+++ b/testcases/kernel/syscalls/bind/bind03.c
@@ -46,11 +46,11 @@ void run(void)
}
/*
- * The behavious diverse according to kernel version
- * for v4.10 or later, the expected error is EADDRINUSE,
+ * The behavior diverse according to kernel version
+ * for v4.4.47~3 or later, the expected error is EADDRINUSE,
* otherwise EINVAL.
*/
- if (tst_kvercmp(4, 10, 0) < 0) {
+ if (tst_kvercmp(4, 4, 48) < 0) {
if (errno != EINVAL) {
tst_res(TFAIL | TERRNO, "expected EINVAL");
return;
--
2.19.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [LTP] [PATCH] syscalls/bind03: fix ret code behavior for v4.4 backport
2018-11-07 13:38 [LTP] [PATCH] syscalls/bind03: fix ret code behavior for v4.4 backport Rafael David Tinoco
@ 2018-11-20 15:20 ` Petr Vorel
2018-11-20 15:44 ` Rafael David Tinoco
0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2018-11-20 15:20 UTC (permalink / raw)
To: ltp
Hi Rafael,
> Recently added test bind03 has a corner case for bind(2). Because
> mainline patch 0fb44559ffd6 ("af_unix: move unix_mknod() out of
> bindlock") got backported to kernel v4.4 as commit 0492a033fb71, the
> corner case must be adapted to correct running kernel version.
...
> /*
> - * The behavious diverse according to kernel version
> - * for v4.10 or later, the expected error is EADDRINUSE,
> + * The behavior diverse according to kernel version
> + * for v4.4.47~3 or later, the expected error is EADDRINUSE,
> * otherwise EINVAL.
> */
> - if (tst_kvercmp(4, 10, 0) < 0) {
> + if (tst_kvercmp(4, 4, 48) < 0) {
> if (errno != EINVAL) {
> tst_res(TFAIL | TERRNO, "expected EINVAL");
> return;
I think this is a wrong approach as there are versions between v4.4 and 4.10
without this patch. IMHO we should accept both EINVAL and EADDRINUSE or accept
Junchi's solution [1].
Kind regards,
Petr
[1] https://patchwork.ozlabs.org/patch/968371/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LTP] [PATCH] syscalls/bind03: fix ret code behavior for v4.4 backport
2018-11-20 15:20 ` Petr Vorel
@ 2018-11-20 15:44 ` Rafael David Tinoco
0 siblings, 0 replies; 3+ messages in thread
From: Rafael David Tinoco @ 2018-11-20 15:44 UTC (permalink / raw)
To: ltp
On 11/20/18 1:20 PM, Petr Vorel wrote:
> Hi Rafael,
>
>> Recently added test bind03 has a corner case for bind(2). Because
>> mainline patch 0fb44559ffd6 ("af_unix: move unix_mknod() out of
>> bindlock") got backported to kernel v4.4 as commit 0492a033fb71, the
>> corner case must be adapted to correct running kernel version.
>
> ...
>> /*
>> - * The behavious diverse according to kernel version
>> - * for v4.10 or later, the expected error is EADDRINUSE,
>> + * The behavior diverse according to kernel version
>> + * for v4.4.47~3 or later, the expected error is EADDRINUSE,
>> * otherwise EINVAL.
>> */
>> - if (tst_kvercmp(4, 10, 0) < 0) {
>> + if (tst_kvercmp(4, 4, 48) < 0) {
>> if (errno != EINVAL) {
>> tst_res(TFAIL | TERRNO, "expected EINVAL");
>> return;
>
> I think this is a wrong approach as there are versions between v4.4 and 4.10
> without this patch. IMHO we should accept both EINVAL and EADDRINUSE or accept
> Junchi's solution [1].
Sure, makes sense! +1.
--
Rafael D. Tinoco
Linaro Kernel Validation
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-20 15:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-07 13:38 [LTP] [PATCH] syscalls/bind03: fix ret code behavior for v4.4 backport Rafael David Tinoco
2018-11-20 15:20 ` Petr Vorel
2018-11-20 15:44 ` Rafael David Tinoco
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.