ltp/fsx: do size check after closeopen operation
authorJosef Bacik <josef@toxicpanda.com>
Tue, 7 Jan 2020 16:55:40 +0000 (11:55 -0500)
committerEryu Guan <guaneryu@gmail.com>
Sat, 1 Feb 2020 07:52:28 +0000 (15:52 +0800)
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
_before_ 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>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
ltp/fsx.c

index 00001117910708264d788a178a0aed22c8522bbc..c74b13c27b841b88b601def02fce020a5029d8b3 100644 (file)
--- 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;
 }