Preserve options on remount in commitChanges

Copy the existing mount options when remounting f2fs for checkpointing
mode.

Bug: 123376509
Test: Boot with checkpointing, and ensure entries match fstab
Change-Id: If022d9872a44657b550ab892259230805716dc77
This commit is contained in:
Daniel Rosenberg 2019-01-24 18:23:18 -08:00
parent f156c40404
commit 14ca4acd86

View file

@ -114,8 +114,10 @@ Status cp_commitChanges() {
if (fs_mgr_is_checkpoint_fs(fstab_rec)) { if (fs_mgr_is_checkpoint_fs(fstab_rec)) {
if (!strcmp(fstab_rec->fs_type, "f2fs")) { if (!strcmp(fstab_rec->fs_type, "f2fs")) {
std::string options = mount_rec->fs_options;
options += ",checkpoint=enable";
if (mount(mount_rec->blk_device, mount_rec->mount_point, "none", if (mount(mount_rec->blk_device, mount_rec->mount_point, "none",
MS_REMOUNT | fstab_rec->flags, "checkpoint=enable")) { MS_REMOUNT | fstab_rec->flags, options.c_str())) {
return Status::fromExceptionCode(EINVAL, "Failed to remount"); return Status::fromExceptionCode(EINVAL, "Failed to remount");
} }
} }