* Re: [LTP] [PATCH] syscalls/umount2_02: remove useless TST_ERR assignment
2022-03-25 21:22 [LTP] [PATCH] syscalls/umount2_02: remove useless TST_ERR assignment Dai Shili
@ 2022-03-25 10:15 ` Petr Vorel
2022-03-28 5:30 ` xuyang2018.jy
0 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2022-03-25 10:15 UTC (permalink / raw)
To: Dai Shili; +Cc: ltp
Hi Dai,
> Signed-off-by: Dai Shili <daisl.fnst@fujitsu.com>
> ---
> testcases/kernel/syscalls/umount2/umount2_02.c | 1 -
> 1 file changed, 1 deletion(-)
> diff --git a/testcases/kernel/syscalls/umount2/umount2_02.c b/testcases/kernel/syscalls/umount2/umount2_02.c
> index 4c3b30e..d1aed11 100644
> --- a/testcases/kernel/syscalls/umount2/umount2_02.c
> +++ b/testcases/kernel/syscalls/umount2/umount2_02.c
> @@ -69,7 +69,6 @@ static int umount2_retry(const char *target, int flags)
> tst_res(TWARN, "Failed to umount('%s', %i) after 50 retries",
> target, flags);
> - TST_ERR = EBUSY;
Not sure if the for loop in umount2_retry() could overwrite the original errno.
Kind regards,
Petr
> return -1;
> }
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
* [LTP] [PATCH] syscalls/umount2_02: remove useless TST_ERR assignment
@ 2022-03-25 21:22 Dai Shili
2022-03-25 10:15 ` Petr Vorel
0 siblings, 1 reply; 7+ messages in thread
From: Dai Shili @ 2022-03-25 21:22 UTC (permalink / raw)
To: ltp
Signed-off-by: Dai Shili <daisl.fnst@fujitsu.com>
---
testcases/kernel/syscalls/umount2/umount2_02.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/testcases/kernel/syscalls/umount2/umount2_02.c b/testcases/kernel/syscalls/umount2/umount2_02.c
index 4c3b30e..d1aed11 100644
--- a/testcases/kernel/syscalls/umount2/umount2_02.c
+++ b/testcases/kernel/syscalls/umount2/umount2_02.c
@@ -69,7 +69,6 @@ static int umount2_retry(const char *target, int flags)
tst_res(TWARN, "Failed to umount('%s', %i) after 50 retries",
target, flags);
- TST_ERR = EBUSY;
return -1;
}
--
1.8.3.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH] syscalls/umount2_02: remove useless TST_ERR assignment
2022-03-25 10:15 ` Petr Vorel
@ 2022-03-28 5:30 ` xuyang2018.jy
2022-03-28 7:12 ` Petr Vorel
2022-03-28 19:56 ` [LTP] [PATCH] syscalls/umount2_02: use umount2 directly instead of TEST macro Dai Shili
0 siblings, 2 replies; 7+ messages in thread
From: xuyang2018.jy @ 2022-03-28 5:30 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp@lists.linux.it
Hi Petr,Dai
> Hi Dai,
>
>> Signed-off-by: Dai Shili<daisl.fnst@fujitsu.com>
>> ---
>> testcases/kernel/syscalls/umount2/umount2_02.c | 1 -
>> 1 file changed, 1 deletion(-)
>
>> diff --git a/testcases/kernel/syscalls/umount2/umount2_02.c b/testcases/kernel/syscalls/umount2/umount2_02.c
>> index 4c3b30e..d1aed11 100644
>> --- a/testcases/kernel/syscalls/umount2/umount2_02.c
>> +++ b/testcases/kernel/syscalls/umount2/umount2_02.c
>> @@ -69,7 +69,6 @@ static int umount2_retry(const char *target, int flags)
>> tst_res(TWARN, "Failed to umount('%s', %i) after 50 retries",
>> target, flags);
>
>> - TST_ERR = EBUSY;
>
> Not sure if the for loop in umount2_retry() could overwrite the original errno.
IMO, in this wrapper, we don't need to use TEST macro and we can use
umount2 directly.
Best Regards
Yang Xu
>
> Kind regards,
> Petr
>
>> return -1;
>> }
>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH] syscalls/umount2_02: remove useless TST_ERR assignment
2022-03-28 5:30 ` xuyang2018.jy
@ 2022-03-28 7:12 ` Petr Vorel
2022-03-28 19:56 ` [LTP] [PATCH] syscalls/umount2_02: use umount2 directly instead of TEST macro Dai Shili
1 sibling, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2022-03-28 7:12 UTC (permalink / raw)
To: xuyang2018.jy@fujitsu.com; +Cc: ltp@lists.linux.it
> Hi Petr,Dai
> > Hi Dai,
> >> Signed-off-by: Dai Shili<daisl.fnst@fujitsu.com>
> >> ---
> >> testcases/kernel/syscalls/umount2/umount2_02.c | 1 -
> >> 1 file changed, 1 deletion(-)
> >> diff --git a/testcases/kernel/syscalls/umount2/umount2_02.c b/testcases/kernel/syscalls/umount2/umount2_02.c
> >> index 4c3b30e..d1aed11 100644
> >> --- a/testcases/kernel/syscalls/umount2/umount2_02.c
> >> +++ b/testcases/kernel/syscalls/umount2/umount2_02.c
> >> @@ -69,7 +69,6 @@ static int umount2_retry(const char *target, int flags)
> >> tst_res(TWARN, "Failed to umount('%s', %i) after 50 retries",
> >> target, flags);
> >> - TST_ERR = EBUSY;
> > Not sure if the for loop in umount2_retry() could overwrite the original errno.
> IMO, in this wrapper, we don't need to use TEST macro and we can use
> umount2 directly.
+1
Kind regards,
Petr
> Best Regards
> Yang Xu
> > Kind regards,
> > Petr
> >> return -1;
> >> }
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH] syscalls/umount2_02: use umount2 directly instead of TEST macro
2022-03-28 19:56 ` [LTP] [PATCH] syscalls/umount2_02: use umount2 directly instead of TEST macro Dai Shili
@ 2022-03-28 9:26 ` xuyang2018.jy
2022-03-30 6:24 ` Petr Vorel
0 siblings, 1 reply; 7+ messages in thread
From: xuyang2018.jy @ 2022-03-28 9:26 UTC (permalink / raw)
To: daisl.fnst@fujitsu.com; +Cc: ltp@lists.linux.it
Hi Dai
Looks good to me,
Reviewed-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Best Regards
Yang Xu
> There is no need to use TEST macro in umount2_retry(),
> because we have used it in TST_EXP_FAIL and TST_EXP_PASS macro.
>
> Signed-off-by: Dai Shili<daisl.fnst@fujitsu.com>
> ---
> testcases/kernel/syscalls/umount2/umount2_02.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/umount2/umount2_02.c b/testcases/kernel/syscalls/umount2/umount2_02.c
> index 4c3b30e..b23f37b 100644
> --- a/testcases/kernel/syscalls/umount2/umount2_02.c
> +++ b/testcases/kernel/syscalls/umount2/umount2_02.c
> @@ -53,12 +53,12 @@ static struct tcase {
>
> static int umount2_retry(const char *target, int flags)
> {
> - int i;
> + int i, ret;
>
> for (i = 0; i< 50; i++) {
> - TEST(umount2(target, flags));
> - if (TST_RET == 0 || TST_ERR != EBUSY)
> - return TST_RET;
> + ret = umount2(target, flags);
> + if (ret == 0 || errno != EBUSY)
> + return ret;
>
> tst_res(TINFO, "umount('%s', %i) failed with EBUSY, try %2i...",
> target, flags, i);
> @@ -69,7 +69,7 @@ static int umount2_retry(const char *target, int flags)
> tst_res(TWARN, "Failed to umount('%s', %i) after 50 retries",
> target, flags);
>
> - TST_ERR = EBUSY;
> + errno = EBUSY;
> return -1;
> }
>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
* [LTP] [PATCH] syscalls/umount2_02: use umount2 directly instead of TEST macro
2022-03-28 5:30 ` xuyang2018.jy
2022-03-28 7:12 ` Petr Vorel
@ 2022-03-28 19:56 ` Dai Shili
2022-03-28 9:26 ` xuyang2018.jy
1 sibling, 1 reply; 7+ messages in thread
From: Dai Shili @ 2022-03-28 19:56 UTC (permalink / raw)
To: xuyang2018.jy; +Cc: ltp
There is no need to use TEST macro in umount2_retry(),
because we have used it in TST_EXP_FAIL and TST_EXP_PASS macro.
Signed-off-by: Dai Shili <daisl.fnst@fujitsu.com>
---
testcases/kernel/syscalls/umount2/umount2_02.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/testcases/kernel/syscalls/umount2/umount2_02.c b/testcases/kernel/syscalls/umount2/umount2_02.c
index 4c3b30e..b23f37b 100644
--- a/testcases/kernel/syscalls/umount2/umount2_02.c
+++ b/testcases/kernel/syscalls/umount2/umount2_02.c
@@ -53,12 +53,12 @@ static struct tcase {
static int umount2_retry(const char *target, int flags)
{
- int i;
+ int i, ret;
for (i = 0; i < 50; i++) {
- TEST(umount2(target, flags));
- if (TST_RET == 0 || TST_ERR != EBUSY)
- return TST_RET;
+ ret = umount2(target, flags);
+ if (ret == 0 || errno != EBUSY)
+ return ret;
tst_res(TINFO, "umount('%s', %i) failed with EBUSY, try %2i...",
target, flags, i);
@@ -69,7 +69,7 @@ static int umount2_retry(const char *target, int flags)
tst_res(TWARN, "Failed to umount('%s', %i) after 50 retries",
target, flags);
- TST_ERR = EBUSY;
+ errno = EBUSY;
return -1;
}
--
1.8.3.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH] syscalls/umount2_02: use umount2 directly instead of TEST macro
2022-03-28 9:26 ` xuyang2018.jy
@ 2022-03-30 6:24 ` Petr Vorel
0 siblings, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2022-03-30 6:24 UTC (permalink / raw)
To: xuyang2018.jy@fujitsu.com; +Cc: ltp@lists.linux.it
Hi Dai
merged, thanks!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-03-30 6:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-25 21:22 [LTP] [PATCH] syscalls/umount2_02: remove useless TST_ERR assignment Dai Shili
2022-03-25 10:15 ` Petr Vorel
2022-03-28 5:30 ` xuyang2018.jy
2022-03-28 7:12 ` Petr Vorel
2022-03-28 19:56 ` [LTP] [PATCH] syscalls/umount2_02: use umount2 directly instead of TEST macro Dai Shili
2022-03-28 9:26 ` xuyang2018.jy
2022-03-30 6:24 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox