From c08a8631e0a333c73029c5699ba9c26d2220aeab Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Fri, 26 Aug 2022 13:59:18 +0800 Subject: [PATCH] agent: add some logs for mount operation Somewhere is lack of log info, add more details about the storage and log when error will help understand what happened. Fixes: #4962 Signed-off-by: Bin Liu --- src/agent/src/mount.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/agent/src/mount.rs b/src/agent/src/mount.rs index 32eaeb3aa5..8a43179c13 100644 --- a/src/agent/src/mount.rs +++ b/src/agent/src/mount.rs @@ -169,11 +169,12 @@ pub fn baremount( info!( logger, - "mount source={:?}, dest={:?}, fs_type={:?}, options={:?}", + "baremount source={:?}, dest={:?}, fs_type={:?}, options={:?}, flags={:?}", source, destination, fs_type, - options + options, + flags ); nix::mount::mount( @@ -779,6 +780,14 @@ pub async fn add_storages( }; // Todo need to rollback the mounted storage if err met. + + if res.is_err() { + error!( + logger, + "add_storages failed, storage: {:?}, error: {:?} ", storage, res + ); + } + let mount_point = res?; if !mount_point.is_empty() {