* [LTP] [PATCH v1] Regression check for unlink fail issue after successful mknod
@ 2023-08-14 23:26 Wei Gao via ltp
2023-08-15 7:05 ` [LTP] [PATCH v2] " Wei Gao via ltp
0 siblings, 1 reply; 3+ messages in thread
From: Wei Gao via ltp @ 2023-08-14 23:26 UTC (permalink / raw)
To: ltp
Write a regression test once making unix_bind() undo mknod on failure patchset is merged.
Kernel patch detail:
git describe --contains c0c3b8d380a8f54c75786d41f6f9efbe761dac6c
v5.14-rc1119^286
git log -p c0c3b8d380a8f54c75786d41f6f9efbe761dac6c
commit c0c3b8d380a8f54c75786d41f6f9efbe761dac6c
Author: Al Viro viro@zeniv.linux.org.uk
Date: Sat Jun 19 03:50:32 2021 +0000
unix_bind_bsd(): unlink if we fail after successful mknod
Signed-off-by: Wei Gao <wegao@suse.com>
---
testcases/kernel/syscalls/bind/bind03.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/bind/bind03.c b/testcases/kernel/syscalls/bind/bind03.c
index 37a040b29..12285acb9 100644
--- a/testcases/kernel/syscalls/bind/bind03.c
+++ b/testcases/kernel/syscalls/bind/bind03.c
@@ -43,8 +43,13 @@ static void run(void)
* locks the socket and does all the checks and the node is not removed
* in the error path. For now we will unlink the node here so that the
* test works fine when the run() function is executed in a loop.
+ * From v5.14-rc1 the kernel has fix above issue.
*/
- unlink(SNAME_B);
+ if (tst_kvercmp(5, 14, 0) >= 0) {
+ TST_EXP_FAIL(unlink(SNAME_B), ENOENT,"check exist of SNAME_B");
+ } else {
+ unlink(SNAME_B);
+ }
}
static void setup(void)
--
2.35.3
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [LTP] [PATCH v2] Regression check for unlink fail issue after successful mknod
2023-08-14 23:26 [LTP] [PATCH v1] Regression check for unlink fail issue after successful mknod Wei Gao via ltp
@ 2023-08-15 7:05 ` Wei Gao via ltp
2023-08-30 8:59 ` Richard Palethorpe
0 siblings, 1 reply; 3+ messages in thread
From: Wei Gao via ltp @ 2023-08-15 7:05 UTC (permalink / raw)
To: ltp
Write a regression test once making unix_bind() undo mknod on failure patchset is merged.
Kernel patch detail:
git describe --contains c0c3b8d380a8f54c75786d41f6f9efbe761dac6c
v5.14-rc1119^286
git log -p c0c3b8d380a8f54c75786d41f6f9efbe761dac6c
commit c0c3b8d380a8f54c75786d41f6f9efbe761dac6c
Author: Al Viro viro@zeniv.linux.org.uk
Date: Sat Jun 19 03:50:32 2021 +0000
unix_bind_bsd(): unlink if we fail after successful mknod
Signed-off-by: Wei Gao <wegao@suse.com>
---
testcases/kernel/syscalls/bind/bind03.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/bind/bind03.c b/testcases/kernel/syscalls/bind/bind03.c
index 37a040b29..8c95cd799 100644
--- a/testcases/kernel/syscalls/bind/bind03.c
+++ b/testcases/kernel/syscalls/bind/bind03.c
@@ -43,8 +43,12 @@ static void run(void)
* locks the socket and does all the checks and the node is not removed
* in the error path. For now we will unlink the node here so that the
* test works fine when the run() function is executed in a loop.
+ * From v5.14-rc1 the kernel has fix above issue.
*/
- unlink(SNAME_B);
+ if (tst_kvercmp(5, 14, 0) >= 0)
+ TST_EXP_FAIL(unlink(SNAME_B), ENOENT, "check exist of SNAME_B");
+ else
+ unlink(SNAME_B);
}
static void setup(void)
--
2.35.3
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH v2] Regression check for unlink fail issue after successful mknod
2023-08-15 7:05 ` [LTP] [PATCH v2] " Wei Gao via ltp
@ 2023-08-30 8:59 ` Richard Palethorpe
0 siblings, 0 replies; 3+ messages in thread
From: Richard Palethorpe @ 2023-08-30 8:59 UTC (permalink / raw)
To: Wei Gao; +Cc: ltp
Hello,
Wei Gao via ltp <ltp@lists.linux.it> writes:
> Write a regression test once making unix_bind() undo mknod on failure patchset is merged.
>
> Kernel patch detail:
> git describe --contains c0c3b8d380a8f54c75786d41f6f9efbe761dac6c
> v5.14-rc1119^286
> git log -p c0c3b8d380a8f54c75786d41f6f9efbe761dac6c
> commit c0c3b8d380a8f54c75786d41f6f9efbe761dac6c
> Author: Al Viro viro@zeniv.linux.org.uk
> Date: Sat Jun 19 03:50:32 2021 +0000
> unix_bind_bsd(): unlink if we fail after successful mknod
>
> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
> testcases/kernel/syscalls/bind/bind03.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/bind/bind03.c b/testcases/kernel/syscalls/bind/bind03.c
> index 37a040b29..8c95cd799 100644
> --- a/testcases/kernel/syscalls/bind/bind03.c
> +++ b/testcases/kernel/syscalls/bind/bind03.c
> @@ -43,8 +43,12 @@ static void run(void)
> * locks the socket and does all the checks and the node is not removed
> * in the error path. For now we will unlink the node here so that the
> * test works fine when the run() function is executed in a loop.
> + * From v5.14-rc1 the kernel has fix above issue.
Usually we don't work around kernel bugs, so really the workaround
should be removed for all versions. However because the workaround was
already accepted, it's a less serious bug and you are removing it on a
subset of kernels, I will just merge it.
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-30 9:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14 23:26 [LTP] [PATCH v1] Regression check for unlink fail issue after successful mknod Wei Gao via ltp
2023-08-15 7:05 ` [LTP] [PATCH v2] " Wei Gao via ltp
2023-08-30 8:59 ` Richard Palethorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox