Skip to content

Commit

Permalink
Erasing a dead disk is likely to fail
Browse files Browse the repository at this point in the history
Put in a little match section just in case erasing a dead
disk fails which it likely will.
  • Loading branch information
cholcombe973 committed Sep 20, 2017
1 parent 640847d commit ad282a0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/backend/ceph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,18 @@ impl CephBackend {
osd_rm(self.cluster_handle, osd_id, simulate)?;

// Wipe the disk
debug!("Erasing disk {:?}", dev_path);
debug!("Erasing disk {}", dev_path.display());
if !simulate {
block_utils::erase_block_device(&dev_path)?;
match block_utils::erase_block_device(&dev_path) {
Ok(_) => {
debug!("{} erased", dev_path.display());
}
Err(e) => {
// At this point the disk is about to be replaced anyways
// so this doesn't really matter
error!("{} failed to erase: {:?}", dev_path.display(), e);
}
};
}

Ok(())
Expand Down

0 comments on commit ad282a0

Please sign in to comment.