[1/3] ltp/fsx: do size check after closeopen operation
diff mbox series

Message ID 20200107165542.70108-2-josef@toxicpanda.com
State New
Headers show
Series
  • Some fsx improvements
Related show

Commit Message

Josef Bacik Jan. 7, 2020, 4:55 p.m. UTC
I was running down a i_size problem and was missing the failure until
the next iteration of fsx operations because we do the file size check
_after_ the closeopen operation.  Move it after the closeopen operation
so we can catch problems where the file gets messed up on disk.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 ltp/fsx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Eryu Guan Feb. 1, 2020, 7:42 a.m. UTC | #1
On Tue, Jan 07, 2020 at 11:55:40AM -0500, Josef Bacik wrote:
> I was running down a i_size problem and was missing the failure until
> the next iteration of fsx operations because we do the file size check
> _after_ the closeopen operation.  Move it after the closeopen operation

I think you mean "_before_" here? And that's why we move it _after_
closeopen?

Thanks,
Eryu

> so we can catch problems where the file gets messed up on disk.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
>  ltp/fsx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ltp/fsx.c b/ltp/fsx.c
> index 00001117..c74b13c2 100644
> --- a/ltp/fsx.c
> +++ b/ltp/fsx.c
> @@ -2211,10 +2211,10 @@ have_op:
>  		check_contents();
>  
>  out:
> -	if (sizechecks && testcalls > simulatedopcount)
> -		check_size();
>  	if (closeopen)
>  		docloseopen();
> +	if (sizechecks && testcalls > simulatedopcount)
> +		check_size();
>  	return 1;
>  }
>  
> -- 
> 2.23.0
>

Patch
diff mbox series

diff --git a/ltp/fsx.c b/ltp/fsx.c
index 00001117..c74b13c2 100644
--- a/ltp/fsx.c
+++ b/ltp/fsx.c
@@ -2211,10 +2211,10 @@  have_op:
 		check_contents();
 
 out:
-	if (sizechecks && testcalls > simulatedopcount)
-		check_size();
 	if (closeopen)
 		docloseopen();
+	if (sizechecks && testcalls > simulatedopcount)
+		check_size();
 	return 1;
 }