diff mbox series

generic/{075,112}: fix printing the incorrect return value of fsx

Message ID 20230301030620.137153-1-xiubli@redhat.com (mailing list archive)
State New, archived
Headers show
Series generic/{075,112}: fix printing the incorrect return value of fsx | expand

Commit Message

Xiubo Li March 1, 2023, 3:06 a.m. UTC
From: Xiubo Li <xiubli@redhat.com>

We need to save the result of the 'fsx' temporarily.

Fixes: https://tracker.ceph.com/issues/58834
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 tests/generic/075 | 6 ++++--
 tests/generic/112 | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

Comments

Darrick J. Wong March 1, 2023, 3:55 p.m. UTC | #1
On Wed, Mar 01, 2023 at 11:06:20AM +0800, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
> 
> We need to save the result of the 'fsx' temporarily.
> 
> Fixes: https://tracker.ceph.com/issues/58834
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  tests/generic/075 | 6 ++++--
>  tests/generic/112 | 6 ++++--
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/generic/075 b/tests/generic/075
> index 03a394a6..bc3a11c7 100755
> --- a/tests/generic/075
> +++ b/tests/generic/075
> @@ -53,9 +53,11 @@ _do_test()
>  
>      # This cd and use of -P gets full debug on "$RESULT_DIR" (not TEST_DEV)
>      cd $out
> -    if ! $here/ltp/fsx $_param -P "$RESULT_DIR" $seq.$_n $FSX_AVOID &>/dev/null
> +    $here/ltp/fsx $_param -P "$RESULT_DIR" $seq.$_n $FSX_AVOID &>/dev/null
> +    local res=$?
> +    if [ $res -ne 0 ]
>      then
> -	echo "    fsx ($_param) failed, $? - compare $seqres.$_n.{good,bad,fsxlog}"
> +	echo "    fsx ($_param) failed, $res - compare $seqres.$_n.{good,bad,fsxlog}"

Heh, oops.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

>  	mv $out/$seq.$_n $seqres.$_n.full
>  	od -xAx $seqres.$_n.full > $seqres.$_n.bad
>  	od -xAx "$RESULT_DIR"/$seq.$_n.fsxgood > $seqres.$_n.good
> diff --git a/tests/generic/112 b/tests/generic/112
> index 971d0467..0e08cbf9 100755
> --- a/tests/generic/112
> +++ b/tests/generic/112
> @@ -53,9 +53,11 @@ _do_test()
>  
>      # This cd and use of -P gets full debug on "$RESULT_DIR" (not TEST_DEV)
>      cd $out
> -    if ! $here/ltp/fsx $_param -P "$RESULT_DIR" $FSX_AVOID $seq.$_n &>/dev/null
> +    $here/ltp/fsx $_param -P "$RESULT_DIR" $FSX_AVOID $seq.$_n &>/dev/null
> +    local res=$?
> +    if [ $res -ne 0 ]
>      then
> -	echo "    fsx ($_param) returned $? - see $seq.$_n.full"
> +	echo "    fsx ($_param) returned $res - see $seq.$_n.full"
>  	mv "$RESULT_DIR"/$seq.$_n.fsxlog $seqres.$_n.full
>  	status=1
>  	exit
> -- 
> 2.31.1
>
Zorro Lang March 2, 2023, 3:38 p.m. UTC | #2
On Wed, Mar 01, 2023 at 11:06:20AM +0800, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
> 
> We need to save the result of the 'fsx' temporarily.
> 
> Fixes: https://tracker.ceph.com/issues/58834
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---

Hmm... how did you generate this patch? Did you change something before you
send this patch out? I can't merge it simply, always got below errors [1] [2].
May you help to generate this patch again purely?

(Of course you can keep the RVB of Darrick)

Thanks,
Zorro

[1]
$ git am ./20230301_xiubli_generic_075_112_fix_printing_the_incorrect_return_value_of_fsx.mbx
Applying: generic/{075,112}: fix printing the incorrect return value of fsx
error: patch failed: tests/generic/075:53
error: tests/generic/075: patch does not apply
Patch failed at 0001 generic/{075,112}: fix printing the incorrect return value of fsx
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

[2]
$ git am -3 ./20230301_xiubli_generic_075_112_fix_printing_the_incorrect_return_value_of_fsx.mbx
Applying: generic/{075,112}: fix printing the incorrect return value of fsx
error: sha1 information is lacking or useless (tests/generic/075).
error: could not build fake ancestor
Patch failed at 0001 generic/{075,112}: fix printing the incorrect return value of fsx
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

>  tests/generic/075 | 6 ++++--
>  tests/generic/112 | 6 ++++--
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/generic/075 b/tests/generic/075
> index 03a394a6..bc3a11c7 100755
> --- a/tests/generic/075
> +++ b/tests/generic/075
> @@ -53,9 +53,11 @@ _do_test()
>  
>      # This cd and use of -P gets full debug on "$RESULT_DIR" (not TEST_DEV)
>      cd $out
> -    if ! $here/ltp/fsx $_param -P "$RESULT_DIR" $seq.$_n $FSX_AVOID &>/dev/null
> +    $here/ltp/fsx $_param -P "$RESULT_DIR" $seq.$_n $FSX_AVOID &>/dev/null
> +    local res=$?
> +    if [ $res -ne 0 ]
>      then
> -	echo "    fsx ($_param) failed, $? - compare $seqres.$_n.{good,bad,fsxlog}"
> +	echo "    fsx ($_param) failed, $res - compare $seqres.$_n.{good,bad,fsxlog}"
>  	mv $out/$seq.$_n $seqres.$_n.full
>  	od -xAx $seqres.$_n.full > $seqres.$_n.bad
>  	od -xAx "$RESULT_DIR"/$seq.$_n.fsxgood > $seqres.$_n.good
> diff --git a/tests/generic/112 b/tests/generic/112
> index 971d0467..0e08cbf9 100755
> --- a/tests/generic/112
> +++ b/tests/generic/112
> @@ -53,9 +53,11 @@ _do_test()
>  
>      # This cd and use of -P gets full debug on "$RESULT_DIR" (not TEST_DEV)
>      cd $out
> -    if ! $here/ltp/fsx $_param -P "$RESULT_DIR" $FSX_AVOID $seq.$_n &>/dev/null
> +    $here/ltp/fsx $_param -P "$RESULT_DIR" $FSX_AVOID $seq.$_n &>/dev/null
> +    local res=$?
> +    if [ $res -ne 0 ]
>      then
> -	echo "    fsx ($_param) returned $? - see $seq.$_n.full"
> +	echo "    fsx ($_param) returned $res - see $seq.$_n.full"
>  	mv "$RESULT_DIR"/$seq.$_n.fsxlog $seqres.$_n.full
>  	status=1
>  	exit
> -- 
> 2.31.1
>
Xiubo Li March 8, 2023, 2:59 a.m. UTC | #3
On 02/03/2023 23:38, Zorro Lang wrote:
> On Wed, Mar 01, 2023 at 11:06:20AM +0800, xiubli@redhat.com wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> We need to save the result of the 'fsx' temporarily.
>>
>> Fixes: https://tracker.ceph.com/issues/58834
>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
>> ---
> Hmm... how did you generate this patch? Did you change something before you
> send this patch out? I can't merge it simply, always got below errors [1] [2].
> May you help to generate this patch again purely?

Hi Zorro,

Sorry I missed this.

Actually this will depend on the previous patch:

"generic/075: no need to move the .fsxlog to the same directory"

I forgot to mention that.

Thanks

- Xiubo


> (Of course you can keep the RVB of Darrick)
>
> Thanks,
> Zorro
>
> [1]
> $ git am ./20230301_xiubli_generic_075_112_fix_printing_the_incorrect_return_value_of_fsx.mbx
> Applying: generic/{075,112}: fix printing the incorrect return value of fsx
> error: patch failed: tests/generic/075:53
> error: tests/generic/075: patch does not apply
> Patch failed at 0001 generic/{075,112}: fix printing the incorrect return value of fsx
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
>
> [2]
> $ git am -3 ./20230301_xiubli_generic_075_112_fix_printing_the_incorrect_return_value_of_fsx.mbx
> Applying: generic/{075,112}: fix printing the incorrect return value of fsx
> error: sha1 information is lacking or useless (tests/generic/075).
> error: could not build fake ancestor
> Patch failed at 0001 generic/{075,112}: fix printing the incorrect return value of fsx
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
>
>>   tests/generic/075 | 6 ++++--
>>   tests/generic/112 | 6 ++++--
>>   2 files changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/tests/generic/075 b/tests/generic/075
>> index 03a394a6..bc3a11c7 100755
>> --- a/tests/generic/075
>> +++ b/tests/generic/075
>> @@ -53,9 +53,11 @@ _do_test()
>>   
>>       # This cd and use of -P gets full debug on "$RESULT_DIR" (not TEST_DEV)
>>       cd $out
>> -    if ! $here/ltp/fsx $_param -P "$RESULT_DIR" $seq.$_n $FSX_AVOID &>/dev/null
>> +    $here/ltp/fsx $_param -P "$RESULT_DIR" $seq.$_n $FSX_AVOID &>/dev/null
>> +    local res=$?
>> +    if [ $res -ne 0 ]
>>       then
>> -	echo "    fsx ($_param) failed, $? - compare $seqres.$_n.{good,bad,fsxlog}"
>> +	echo "    fsx ($_param) failed, $res - compare $seqres.$_n.{good,bad,fsxlog}"
>>   	mv $out/$seq.$_n $seqres.$_n.full
>>   	od -xAx $seqres.$_n.full > $seqres.$_n.bad
>>   	od -xAx "$RESULT_DIR"/$seq.$_n.fsxgood > $seqres.$_n.good
>> diff --git a/tests/generic/112 b/tests/generic/112
>> index 971d0467..0e08cbf9 100755
>> --- a/tests/generic/112
>> +++ b/tests/generic/112
>> @@ -53,9 +53,11 @@ _do_test()
>>   
>>       # This cd and use of -P gets full debug on "$RESULT_DIR" (not TEST_DEV)
>>       cd $out
>> -    if ! $here/ltp/fsx $_param -P "$RESULT_DIR" $FSX_AVOID $seq.$_n &>/dev/null
>> +    $here/ltp/fsx $_param -P "$RESULT_DIR" $FSX_AVOID $seq.$_n &>/dev/null
>> +    local res=$?
>> +    if [ $res -ne 0 ]
>>       then
>> -	echo "    fsx ($_param) returned $? - see $seq.$_n.full"
>> +	echo "    fsx ($_param) returned $res - see $seq.$_n.full"
>>   	mv "$RESULT_DIR"/$seq.$_n.fsxlog $seqres.$_n.full
>>   	status=1
>>   	exit
>> -- 
>> 2.31.1
>>
diff mbox series

Patch

diff --git a/tests/generic/075 b/tests/generic/075
index 03a394a6..bc3a11c7 100755
--- a/tests/generic/075
+++ b/tests/generic/075
@@ -53,9 +53,11 @@  _do_test()
 
     # This cd and use of -P gets full debug on "$RESULT_DIR" (not TEST_DEV)
     cd $out
-    if ! $here/ltp/fsx $_param -P "$RESULT_DIR" $seq.$_n $FSX_AVOID &>/dev/null
+    $here/ltp/fsx $_param -P "$RESULT_DIR" $seq.$_n $FSX_AVOID &>/dev/null
+    local res=$?
+    if [ $res -ne 0 ]
     then
-	echo "    fsx ($_param) failed, $? - compare $seqres.$_n.{good,bad,fsxlog}"
+	echo "    fsx ($_param) failed, $res - compare $seqres.$_n.{good,bad,fsxlog}"
 	mv $out/$seq.$_n $seqres.$_n.full
 	od -xAx $seqres.$_n.full > $seqres.$_n.bad
 	od -xAx "$RESULT_DIR"/$seq.$_n.fsxgood > $seqres.$_n.good
diff --git a/tests/generic/112 b/tests/generic/112
index 971d0467..0e08cbf9 100755
--- a/tests/generic/112
+++ b/tests/generic/112
@@ -53,9 +53,11 @@  _do_test()
 
     # This cd and use of -P gets full debug on "$RESULT_DIR" (not TEST_DEV)
     cd $out
-    if ! $here/ltp/fsx $_param -P "$RESULT_DIR" $FSX_AVOID $seq.$_n &>/dev/null
+    $here/ltp/fsx $_param -P "$RESULT_DIR" $FSX_AVOID $seq.$_n &>/dev/null
+    local res=$?
+    if [ $res -ne 0 ]
     then
-	echo "    fsx ($_param) returned $? - see $seq.$_n.full"
+	echo "    fsx ($_param) returned $res - see $seq.$_n.full"
 	mv "$RESULT_DIR"/$seq.$_n.fsxlog $seqres.$_n.full
 	status=1
 	exit