From 78d45b434fe415ee28dbb8dd7ceb8d25a2d62028 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 31 May 2022 23:36:14 +0800 Subject: [PATCH] agent: return mount file content if parse mountinfo failed Include mount file content in error message when parsing mountinfo failed for debug. Fixes: #4246, #4103 Signed-off-by: Bin Liu --- src/agent/src/mount.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/agent/src/mount.rs b/src/agent/src/mount.rs index d4729c881a..ff24f49571 100644 --- a/src/agent/src/mount.rs +++ b/src/agent/src/mount.rs @@ -859,8 +859,9 @@ pub fn get_mount_fs_type_from_file(mount_file: &str, mount_point: &str) -> Resul } Err(anyhow!( - "failed to find FS type for mount point {}", - mount_point + "failed to find FS type for mount point {}, mount file content: {:?}", + mount_point, + fs::read_to_string(mount_file) )) }