Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df2faa42 authored by Randall Huang's avatar Randall Huang Committed by YH_Lin
Browse files

reboot: only run fsck when detecting filesystem inconsistency



Running fsck when filesystem is in clean state is unnecessary
and causes long shutdown duration.

Bug: 120575926
Test: shutdown
Change-Id: I0562bdad4ac2fb2dd3c9617f96ca3d6279876bd8
Signed-off-by: default avatarRandall Huang <huangrandall@google.com>
parent 6410fd24
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -103,13 +103,17 @@ class MountEntry {
        int st;
        if (IsF2Fs()) {
            const char* f2fs_argv[] = {
                "/system/bin/fsck.f2fs", "-f", mnt_fsname_.c_str(),
                    "/system/bin/fsck.f2fs",
                    "-a",
                    mnt_fsname_.c_str(),
            };
            android_fork_execvp_ext(arraysize(f2fs_argv), (char**)f2fs_argv, &st, true, LOG_KLOG,
                                    true, nullptr, nullptr, 0);
        } else if (IsExt4()) {
            const char* ext4_argv[] = {
                "/system/bin/e2fsck", "-f", "-y", mnt_fsname_.c_str(),
                    "/system/bin/e2fsck",
                    "-y",
                    mnt_fsname_.c_str(),
            };
            android_fork_execvp_ext(arraysize(ext4_argv), (char**)ext4_argv, &st, true, LOG_KLOG,
                                    true, nullptr, nullptr, 0);