diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index 0938fff90ae770..711cc349ae346b 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -849,12 +849,11 @@ fn hard_link_appendvec_files_to_snapshot( ) -> Result<()> { let dir_accounts_hard_links = bank_snapshots_dir.as_ref().join("accounts"); fs::create_dir(&dir_accounts_hard_links).map_err(|e| { - let err_msg = format!( - "Error: {}. Failed to create the hard-link dir {}.", + SnapshotError::IoWithSourceAndFile( e, - dir_accounts_hard_links.display(), - ); - SnapshotError::Io(IoError::new(ErrorKind::Other, err_msg)) + "create hard-link dir", + dir_accounts_hard_links.clone(), + ) })?; for slot_storages in snapshot_storages { @@ -2187,8 +2186,9 @@ pub fn verify_snapshot_archive( assert!(crate::serde_snapshot::compare_two_serialized_banks(&p1, &p2).unwrap()); std::fs::remove_file(p1).unwrap(); std::fs::remove_file(p2).unwrap(); - // Remove the new accounts/ to be consistent with the - // old archive structure. + // Remove the new accounts/ hard-link directory to be consistent with the + // old archive structure, so that the directory comparison checking in the test + // passes. let accounts_path = snapshot_slot_dir.join("accounts"); if accounts_path.is_dir() { // Do not use the async move_and_async_delete_path because the assert below