diff options
author | Alex Auvolat <alex@adnab.me> | 2024-03-26 16:34:40 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2024-03-26 16:34:40 +0100 |
commit | f7cd4eb60093910fe23745fce69db49fce591c32 (patch) | |
tree | 9d219453954f7616874d7bfa76e93fa843dfaa4e /src/block/manager.rs | |
parent | cdde0f19ee37848370d4a138d95c55bfaca820ed (diff) | |
parent | 95eb8808e8ede5439cf6352ce4f9a148fac2f236 (diff) | |
download | garage-f7cd4eb60093910fe23745fce69db49fce591c32.tar.gz garage-f7cd4eb60093910fe23745fce69db49fce591c32.zip |
Merge branch 'main' into next-0.10
Diffstat (limited to 'src/block/manager.rs')
-rw-r--r-- | src/block/manager.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/block/manager.rs b/src/block/manager.rs index 8ee33096..82db2cab 100644 --- a/src/block/manager.rs +++ b/src/block/manager.rs @@ -127,17 +127,15 @@ impl BlockManager { // Load or compute layout, i.e. assignment of data blocks to the different data directories let data_layout_persister: Persister<DataLayout> = Persister::new(&system.metadata_dir, "data_layout"); - let data_layout = match data_layout_persister.load() { - Ok(mut layout) => { - layout - .update(&config.data_dir) - .ok_or_message("invalid data_dir config")?; - layout - } + let mut data_layout = match data_layout_persister.load() { + Ok(layout) => layout + .update(&config.data_dir) + .ok_or_message("invalid data_dir config")?, Err(_) => { DataLayout::initialize(&config.data_dir).ok_or_message("invalid data_dir config")? } }; + data_layout.check_markers()?; data_layout_persister .save(&data_layout) .expect("cannot save data_layout"); |