From d0139b45b8732fe0e610e309373f7f1881bccb42 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Tue, 9 Jan 2024 17:14:07 -0800 Subject: [PATCH] Mark block device as rw before encryptFstab Some testcases assume that /dev/block/by-name/userdata is writable, but mount_with_alternatives() will mark block device as RO if mount flag includes MS_RDONLY. Fix it by marking the block device as RW again. Test: th Bug: 319156415 Change-Id: Ic04acd4b6175d3f0aeea88675da44309e8df15e8 --- fs_mgr/fs_mgr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp index b0e2d6da4..8c0c1efe3 100644 --- a/fs_mgr/fs_mgr.cpp +++ b/fs_mgr/fs_mgr.cpp @@ -1550,6 +1550,7 @@ MountAllResult fs_mgr_mount_all(Fstab* fstab, int mount_mode) { } encryptable = status; if (status == FS_MGR_MNTALL_DEV_NEEDS_METADATA_ENCRYPTION) { + fs_mgr_set_blk_ro(attempted_entry.blk_device, false); if (!call_vdc({"cryptfs", "encryptFstab", attempted_entry.blk_device, attempted_entry.mount_point, wiped ? "true" : "false", attempted_entry.fs_type, attempted_entry.zoned_device},