From 06db803f32270c055b4950857cc759d39ab1f970 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Thu, 6 Jan 2022 17:28:41 -0800 Subject: [PATCH] Run check_fs only /data is mounted After switching to /system from ramdisk, first_stage_init has no required libraries for check_fs. [ 20.838811][ T1] init: [libfs_mgr]Created logical partition scratch on device /dev/block/dm-6 [ 20.972704][ T1] init: [libfs_mgr]Running /system/bin/fsck.f2fs -a -c 10000 --debug-cache /dev/block/dm-6 [ 20.977879][ T345] logwrapper: executing /system/bin/fsck.f2fs failed: No such file or directory [ 20.978470][ T1] fsck.f2fs: executing /system/bin/fsck.f2fs failed: No such file or directory [ 20.981137][ T1] fsck.f2fs: fsck.f2fs terminated by exit(255) [ 21.002958][ T1] init: [libfs_mgr]__mount(source=/dev/block/dm-6,target=/mnt/scratch,type=f2fs)=0: Success [ 21.017748][ T1] init: [libfs_mgr]umount(/mnt/scratch) [ 21.021028][ T1] init: [libfs_mgr]Running /system/bin/fsck.f2fs -a -c 10000 --debug-cache /dev/block/dm-6 [ 21.028759][ T347] logwrapper: executing /system/bin/fsck.f2fs failed: No such file or directory [ 21.028793][ T1] fsck.f2fs: executing /system/bin/fsck.f2fs failed: No such file or directory [ 21.049100][ T1] fsck.f2fs: fsck.f2fs terminated by exit(255) [ 21.068101][ T1] init: [libfs_mgr]__mount(source=/dev/block/dm-6,target=/mnt/scratch,type=f2fs)=0: Success Bug: 210589189 Signed-off-by: Jaegeuk Kim Change-Id: Ie41cba4e7553860fdb48996d9b58a34093f0b723 --- fs_mgr/fs_mgr_overlayfs.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs_mgr/fs_mgr_overlayfs.cpp b/fs_mgr/fs_mgr_overlayfs.cpp index 2b311194d..3cb82ca4e 100644 --- a/fs_mgr/fs_mgr_overlayfs.cpp +++ b/fs_mgr/fs_mgr_overlayfs.cpp @@ -882,7 +882,10 @@ bool fs_mgr_overlayfs_mount_scratch(const std::string& device_path, const std::s entry.flags &= ~MS_RDONLY; fs_mgr_set_blk_ro(device_path, false); } - entry.fs_mgr_flags.check = true; + // check_fs requires apex runtime library + if (fs_mgr_overlayfs_already_mounted("/data", false)) { + entry.fs_mgr_flags.check = true; + } auto save_errno = errno; if (mounted) mounted = fs_mgr_do_mount_one(entry) == 0; if (!mounted) {