[thin_check] fix bugs in thin_check -m

This commit is contained in:
Joe Thornber 2020-06-12 13:41:47 +01:00
parent ace8b39a8a
commit 0b5afc6cb0
2 changed files with 6 additions and 3 deletions

View File

@ -401,7 +401,8 @@ namespace {
//----------------------------------------------------------------
check_options::check_options()
: check_data_mappings_(DATA_MAPPING_LEVEL2),
: use_metadata_snap_(false),
check_data_mappings_(DATA_MAPPING_LEVEL2),
sm_opts_(SPACE_MAP_FULL) {
}
@ -420,6 +421,7 @@ void check_options::set_override_mapping_root(block_address b) {
}
void check_options::set_metadata_snap() {
use_metadata_snap_ = true;
sm_opts_ = SPACE_MAP_NONE;
}

View File

@ -76,7 +76,8 @@ namespace {
return 1;
}
block_manager::ptr bm = open_bm(path);
block_manager::ptr bm = open_bm(path, block_manager::READ_ONLY,
!fs.check_opts.use_metadata_snap_);
output_options output_opts = !fs.quiet ? OUTPUT_NORMAL : OUTPUT_QUIET;
error_state err = check_metadata(bm, fs.check_opts, output_opts);
@ -128,7 +129,7 @@ thin_check_cmd::run(int argc, char **argv)
int c;
flags fs;
char const shortopts[] = "qhV";
char const shortopts[] = "qhVm";
option const longopts[] = {
{ "quiet", no_argument, NULL, 'q'},
{ "help", no_argument, NULL, 'h'},