diff --git a/src/libs/kata-sys-util/src/mount.rs b/src/libs/kata-sys-util/src/mount.rs index 66e47998fb..2bc8c07a5a 100644 --- a/src/libs/kata-sys-util/src/mount.rs +++ b/src/libs/kata-sys-util/src/mount.rs @@ -739,18 +739,15 @@ pub fn umount_all>(mountpoint: P, lazy_umount: bool) -> Result<() } loop { - match umount2(mountpoint.as_ref(), lazy_umount) { - Err(e) => { - // EINVAL is returned if the target is not a mount point, indicating that we are - // done. It can also indicate a few other things (such as invalid flags) which we - // unfortunately end up squelching here too. - if e.kind() == io::ErrorKind::InvalidInput { - break; - } else { - return Err(Error::Umount(mountpoint.as_ref().to_path_buf(), e)); - } + if let Err(e) = umount2(mountpoint.as_ref(), lazy_umount) { + // EINVAL is returned if the target is not a mount point, indicating that we are + // done. It can also indicate a few other things (such as invalid flags) which we + // unfortunately end up squelching here too. + if e.kind() == io::ErrorKind::InvalidInput { + break; + } else { + return Err(Error::Umount(mountpoint.as_ref().to_path_buf(), e)); } - Ok(()) => (), } } diff --git a/src/libs/logging/src/lib.rs b/src/libs/logging/src/lib.rs index 6275c63663..d72292a2c4 100644 --- a/src/libs/logging/src/lib.rs +++ b/src/libs/logging/src/lib.rs @@ -545,8 +545,8 @@ mod tests { let msg = format!("test[{}]", i); // Create a writer for the logger drain to use - let writer = - NamedTempFile::new().unwrap_or_else(|_| panic!("{:}: failed to create tempfile", msg)); + let writer = NamedTempFile::new() + .unwrap_or_else(|_| panic!("{:}: failed to create tempfile", msg)); // Used to check file contents before the temp file is unlinked let mut writer_ref = writer diff --git a/src/runtime-rs/crates/shim/src/logger.rs b/src/runtime-rs/crates/shim/src/logger.rs index fc82df73d4..50ba891fb3 100644 --- a/src/runtime-rs/crates/shim/src/logger.rs +++ b/src/runtime-rs/crates/shim/src/logger.rs @@ -35,7 +35,7 @@ pub(crate) fn set_logger(path: &str, sid: &str, is_debug: bool) -> Result