recovery: add a way to enable metadata_csum for ext4

Requires to add "metadata_csum" in fsmgr_flag of fstab.

Bug: 149039306
Change-Id: I2b95dcaaf2ba224135ad51f117b7b01bbf342b7e
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
This commit is contained in:
Jaegeuk Kim
2020-02-11 15:24:54 -08:00
parent 2015fe5dbc
commit a8d36e1ea9
+9
View File
@@ -202,6 +202,15 @@ int format_volume(const std::string& volume, const std::string& directory) {
mke2fs_args.push_back("512");
}
if (v->fs_mgr_flags.ext_meta_csum) {
mke2fs_args.push_back("-O");
mke2fs_args.push_back("metadata_csum");
mke2fs_args.push_back("-O");
mke2fs_args.push_back("64bit");
mke2fs_args.push_back("-O");
mke2fs_args.push_back("extent");
}
int raid_stride = v->logical_blk_size / kBlockSize;
int raid_stripe_width = v->erase_blk_size / kBlockSize;
// stride should be the max of 8KB and logical block size