[thin_restore (rust)] Apply several fixes
- Fix reading queued blocks - Fix unnecessary block shadowing when there's no remaining values - Prevent superblock from overwritten - Flush queued writes before updating superblock
This commit is contained in:
@@ -98,6 +98,7 @@ impl<'a> Pass1<'a> {
|
||||
impl<'a> MetadataVisitor for Pass1<'a> {
|
||||
fn superblock_b(&mut self, sb: &xml::Superblock) -> Result<Visit> {
|
||||
self.result.sb = Some(sb.clone());
|
||||
self.w.alloc()?;
|
||||
Ok(Visit::Continue)
|
||||
}
|
||||
|
||||
@@ -277,6 +278,8 @@ pub fn restore(opts: ThinRestoreOptions) -> Result<()> {
|
||||
// FIXME: I think we need to decrement the shared leaves
|
||||
// Build metadata space map
|
||||
|
||||
w.flush()?;
|
||||
|
||||
// Write the superblock
|
||||
if let Some(xml_sb) = pass.sb {
|
||||
let sb = superblock::Superblock {
|
||||
|
||||
Reference in New Issue
Block a user