syscalls/umount2_02: remove useless TST_ERR assignment
PATCH 1/1 syscalls/umount2_02: remove useless TST_ERR assignment
--- testcases/kernel/syscalls/umount2/umount2_02.c | 1 - 1 file changed, 1 deletion(-)
testcases/kernel/syscalls/umount2/umount2_02.c +0 -1
@@ -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 ; }
Signature · 5 lines
1.8.3.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Dai,
Quoted 10 lines
Signed-off-by Dai Shili <[email protected]>--- testcases/kernel/syscalls/umount2/umount2_02.c | 1 - 1 file changed, 1 deletion(-)testcases/kernel/syscalls/umount2/umount2_02.c +0
-0
testcases/kernel/syscalls/umount2/umount2_02.c static int umount2_retry(const char *target, int flags) · line 72
Quoted 4 lines
testcases/kernel/syscalls/umount2/umount2_02.c +0
-1@@ -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
Quoted 2 lines
testcases/kernel/syscalls/umount2/umount2_02.c +0
-0return -1 ; }
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Petr,Dai
Quoted 15 lines
Hi Dai,
Quoted 12 lines
Signed-off-by Dai Shili<[email protected]>--- testcases/kernel/syscalls/umount2/umount2_02.c | 1 - 1 file changed, 1 deletion(-)testcases/kernel/syscalls/umount2/umount2_02.c +0
-0@@ -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);
Quoted 3 lines
testcases/kernel/syscalls/umount2/umount2_02.c static int umount2_retry(const char *target, int flags) · line 72
Quoted 1 line
testcases/kernel/syscalls/umount2/umount2_02.c +0
-1-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
Quoted 7 lines
Kind regards,
PetrQuoted 2 lines
testcases/kernel/syscalls/umount2/umount2_02.c +0
-0return -1 ; }
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 16 lines
Hi Petr,Dai
Quoted 14 lines
Hi Dai,
Quoted 12 lines
Signed-off-by Dai Shili<[email protected]>--- testcases/kernel/syscalls/umount2/umount2_02.c | 1 - 1 file changed, 1 deletion(-)testcases/kernel/syscalls/umount2/umount2_02.c +0
-0@@ -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);
Quoted 5 lines
Quoted 3 lines
testcases/kernel/syscalls/umount2/umount2_02.c static int umount2_retry(const char *target, int flags) · line 72
Quoted 1 line
testcases/kernel/syscalls/umount2/umount2_02.c +0
-1-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
Quoted 8 lines
Best Regards
Yang XuQuoted 5 lines
Kind regards,
PetrQuoted 2 lines
testcases/kernel/syscalls/umount2/umount2_02.c +0
-0return -1 ; }
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 1/1 syscalls/umount2_02: use umount2 directly instead of TEST macro
In reply to [email protected]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.
--- testcases/kernel/syscalls/umount2/umount2_02.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
testcases/kernel/syscalls/umount2/umount2_02.c +5 -5
@@ -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 ; }
Signature · 5 lines
1.8.3.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH] syscalls/umount2_02: use umount2 directly instead of TEST macro
Hi Dai
Looks good to me,
Best Regards
Yang Xu
Quoted 38 lines
There is no need to use TEST macro in
umount2_retry(), because we have used it inTST_EXP_FAILandTST_EXP_PASSmacro.Signed-off-by Dai Shili<[email protected]>--- testcases/kernel/syscalls/umount2/umount2_02.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)testcases/kernel/syscalls/umount2/umount2_02.c +5
-5@@ -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 ; }
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Petr Vorel
AppliedRe: [LTP] [PATCH] syscalls/umount2_02: use umount2 directly instead of TEST macro
Hi Dai
merged, thanks!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp