summaryrefslogtreecommitdiff
path: root/ubifs-utils/fsck.ubifs/fsck.ubifs.c
diff options
context:
space:
mode:
authorXiang Yang <xiangyang3@huawei.com>2024-11-11 17:08:06 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2024-11-11 10:32:46 +0100
commitd0b66b0e5bb346e795a4c0ac3cafd287a6e4db9d (patch)
treea266718d7a77f1995d4d5a2ee53cbe843cd1dd6d /ubifs-utils/fsck.ubifs/fsck.ubifs.c
parenta251dd9c71006c66a02064210ae103ed7ac59444 (diff)
fsck.ubifs: Check and correct files' information
This is the 10/18 step of fsck. Check and handle inconsistent files, the checking rule is same as rebuild mode which has been implemented in check_and_correct_files, but the methods of handling are different: 1. Correct the file information for safe mode, danger mode and normal mode with 'yes' answer, other modes will exit. Signed-off-by: Xiang Yang <xiangyang3@huawei.com> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/fsck.ubifs/fsck.ubifs.c')
-rw-r--r--ubifs-utils/fsck.ubifs/fsck.ubifs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ubifs-utils/fsck.ubifs/fsck.ubifs.c b/ubifs-utils/fsck.ubifs/fsck.ubifs.c
index 6a718fd..3f61668 100644
--- a/ubifs-utils/fsck.ubifs/fsck.ubifs.c
+++ b/ubifs-utils/fsck.ubifs/fsck.ubifs.c
@@ -460,6 +460,13 @@ static int do_fsck(void)
goto free_disconnected_files;
}
+ log_out(c, "Check and correct files");
+ err = check_and_correct_files(c);
+ if (err) {
+ exit_code |= FSCK_ERROR;
+ goto free_disconnected_files;
+ }
+
free_disconnected_files:
destroy_file_list(c, &FSCK(c)->disconnected_files);
free_used_lebs:
@@ -504,6 +511,7 @@ int main(int argc, char *argv[])
* Step 7: Update files' size
* Step 8: Check and handle invalid files
* Step 9: Check and handle unreachable files
+ * Step 10: Check and correct files
*/
err = do_fsck();
if (err && FSCK(c)->try_rebuild) {