_check_xfs_filesystem: sync fs before running scrub
authorChandan Babu R <chandanrlinux@gmail.com>
Tue, 9 Mar 2021 05:01:12 +0000 (10:31 +0530)
committerEryu Guan <guaneryu@gmail.com>
Sun, 21 Mar 2021 13:34:26 +0000 (21:34 +0800)
commit1066be0dd6f2671dae7c73db69624d659e40f8a1
tree711266ab0da3e9dd14ba30765bff46d99e9cc217
parent9fb30a9500c169b0e94353313bff201da2348952
_check_xfs_filesystem: sync fs before running scrub

Tests can create a scenario in which a call to syncfs() issued at the end of
the execution of the test script would return an error code. xfs_scrub
internally calls syncfs() before starting the actual online consistency check
operation. Since this call to syncfs() fails, xfs_scrub ends up returning
without performing consistency checks on the test filesystem. This can mask a
possible on-disk data structure corruption.

To fix the above stated problem, this commit invokes syncfs() prior to
executing xfs_scrub.

Suggested-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
common/xfs