]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
overlay: correct fsck.overlay exit code
authorzhangyi (F) <yi.zhang@huawei.com>
Tue, 28 May 2019 15:17:22 +0000 (18:17 +0300)
committerEryu Guan <guaneryu@gmail.com>
Sun, 2 Jun 2019 07:06:11 +0000 (15:06 +0800)
commitaf3a63c4dcdd88c246e1adf3c6b600bc52a63b53
tree6e42fd6fafc7d0471843eb626a3e635231ffc4c8
parentd9f4cb727142efe783f6009e28963531539a0459
overlay: correct fsck.overlay exit code

fsck.overlay should return correct exit code to show the file system
status after fsck, instead of return 0 means consistency and !0 means
inconsistency or something bad happened.

Fix the following three exit code after running fsck.overlay:

- Return FSCK_OK if the input file system is consistent,
- Return FSCK_NONDESTRUCT if the file system inconsistent errors
  corrected,
- Return FSCK_UNCORRECTED if the file system still have inconsistent
  errors.

This patch also add a helper function to run fsck.overlay and check
the return value is expected or not.

[amir] rename helper to _overlay_fsck_expect, split define of FSCK_*
to a seprate path.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/overlay
tests/overlay/045
tests/overlay/046
tests/overlay/056