Mount /mnt/scracth with -o sync,nodiscard

"-o discard" issues UNMAP commands to loopback resulting in punch_hole
on the pinned file in /data. That will break the pinned block map.

Bug: 210589189
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ia927c43fc75164ce5929173f5740737eac4de484
This commit is contained in:
Jaegeuk Kim 2021-12-29 13:17:15 -08:00
parent 06db803f32
commit bbad87aeee
1 changed files with 2 additions and 0 deletions

View File

@ -880,6 +880,8 @@ bool fs_mgr_overlayfs_mount_scratch(const std::string& device_path, const std::s
errno = save_errno;
}
entry.flags &= ~MS_RDONLY;
entry.flags |= MS_SYNCHRONOUS;
entry.fs_options = "nodiscard";
fs_mgr_set_blk_ro(device_path, false);
}
// check_fs requires apex runtime library