26 lines
1.0 KiB
Diff
26 lines
1.0 KiB
Diff
diff --git a/src/bin/mount.rs b/src/bin/mount.rs
|
|
index dba7f3c..70cf661 100644
|
|
--- a/src/bin/mount.rs
|
|
+++ b/src/bin/mount.rs
|
|
@@ -292 +292,19 @@ fn daemon(
|
|
- DiskId::Uuid(ref uuid) => filesystem_by_uuid(uuid, block_opt),
|
|
+ DiskId::Uuid(ref uuid) => {
|
|
+ let max_attempts = 20;
|
|
+ let mut attempt = 0;
|
|
+ loop {
|
|
+ attempt += 1;
|
|
+ if let Some(result) = filesystem_by_uuid(uuid, block_opt) {
|
|
+ break Some(result);
|
|
+ }
|
|
+ if attempt >= max_attempts {
|
|
+ log::error!("uuid search exhausted {} attempts", attempt);
|
|
+ break None;
|
|
+ }
|
|
+ #[cfg(target_os = "redox")]
|
|
+ std::thread::sleep(std::time::Duration::from_millis(200));
|
|
+ #[cfg(not(target_os = "redox"))]
|
|
+ std::thread::sleep(std::time::Duration::from_millis(200));
|
|
+ log::debug!("uuid search retry {}/{}", attempt, max_attempts);
|
|
+ }
|
|
+ }
|