Skip to content

Commit

Permalink
Settle udev before querying for filesystem uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
cholcombe973 committed Sep 21, 2017
1 parent 7122962 commit c893586
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/backend/ceph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ impl CephBackend {
);
if !simulate {
block_utils::format_block_device(dev_path, &xfs_options)?;
settle_udev();
}

// Probe the drive
Expand Down Expand Up @@ -498,6 +499,17 @@ fn setup_osd_init(osd_id: u64, simulate: bool) -> Result<(), String> {
Ok(())
}

fn settle_udev() -> IOResult<()> {
let output = Command::new("udevadm").arg("settle").output()?;
if !output.status.success() {
return Err(::std::io::Error::new(
::std::io::ErrorKind::NotFound,
String::from_utf8_lossy(&output.stderr).into_owned(),
));
}
Ok(())
}

fn ceph_mkfs(osd_id: u64, journal: Option<&Path>, simulate: bool) -> Result<(), String> {
//
debug!("Running ceph-osd --mkfs");
Expand Down

0 comments on commit c893586

Please sign in to comment.