improve pddb init

This commit is contained in:
bunnie 2025-11-12 22:08:01 +08:00
parent 63e78b202b
commit c3c86e857b
2 changed files with 6 additions and 2 deletions

View file

@ -2510,7 +2510,7 @@ impl PddbOs {
}
}
self.entropy.borrow_mut().get_slice(&mut temp);
if (offset / PAGE_SIZE) % 256 == 0 {
if (offset / PAGE_SIZE) % 32 == 0 {
// ~one update per megabyte
log::info!("Cryptographic 'erase': {}/{}", offset, PDDB_A_LEN);
if let Some(modals) = progress {

View file

@ -841,7 +841,11 @@ fn wrapped_main() -> ! {
unreachable!();
}
PasswordState::Incorrect(_failcount) => {
unreachable!();
log::warn!("PDDB formatted, but keys rotated. Formatting PDDB!");
pddb_os.pddb_format(false, None).expect("couldn't format PDDB");
if !try_mount(&mut pddb_os, &mut basis_cache, &mut basis_monitor_notifications) {
panic!("Couldn't format & mount PDDB");
}
}
}
// the above operation should either succeed or panic, so we are always "success" here