From df2faa4238776e2b30424ac01c84e9864149a139 Mon Sep 17 00:00:00 2001 From: Randall Huang Date: Tue, 15 Jan 2019 15:00:56 +0800 Subject: [PATCH] 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: Randall Huang --- init/reboot.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/init/reboot.cpp b/init/reboot.cpp index 45dc6d316..008a868c8 100644 --- a/init/reboot.cpp +++ b/init/reboot.cpp @@ -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);