summaryrefslogtreecommitdiff
path: root/ubifs-utils/fsck.ubifs/fsck.ubifs.c
diff options
context:
space:
mode:
authorZhihao Cheng <chengzhihao1@huawei.com>2024-11-11 17:08:13 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2024-11-11 10:32:46 +0100
commitb064a78fb9a9503a4bf87a5149ca8fe5711b2cff (patch)
tree57cc3bd5087647f881bad3b4200dd348b2033d26 /ubifs-utils/fsck.ubifs/fsck.ubifs.c
parentdf5d5489aed7ae9de007776e19350bd5aebbfea2 (diff)
fsck.ubifs: Check and create the root dir
This is the 15/18 step of fsck. Check whether the root dir is existed, create a new one if it is not found. This step makes sure that filesystem can be mounted successful. 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 80205aa..b97c8e3 100644
--- a/ubifs-utils/fsck.ubifs/fsck.ubifs.c
+++ b/ubifs-utils/fsck.ubifs/fsck.ubifs.c
@@ -519,6 +519,13 @@ static int do_fsck(void)
log_out(c, "Check and correct the index size");
err = check_and_correct_index_size(c);
+ if (err) {
+ exit_code |= FSCK_ERROR;
+ goto free_disconnected_files_2;
+ }
+
+ log_out(c, "Check and create root dir");
+ err = check_and_create_root(c);
if (err)
exit_code |= FSCK_ERROR;
@@ -575,6 +582,7 @@ int main(int argc, char *argv[])
* Step 12: Check and correct the space statistics
* Step 13: Commit problem fixing modifications
* Step 14: Check and correct the index size
+ * Step 15: Check and create root dir
*/
err = do_fsck();
if (err && FSCK(c)->try_rebuild) {