Add trace! logging for server-side getattr
continuous-integration/drone the build was successful
Details
continuous-integration/drone the build was successful
Details
This commit is contained in:
parent
7fbe51db68
commit
300baef5c5
|
@ -7,7 +7,8 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
## Robustness
|
||||
log = "0.4.14"
|
||||
# Disable trace! in release mode.
|
||||
log = { version = "0.4.14", features = ["release_max_level_debug"] }
|
||||
env_logger = "0.9.0"
|
||||
anyhow = "1.0.52"
|
||||
bare-metrics-recorder = "0.1.0"
|
||||
|
|
|
@ -14,7 +14,7 @@ use std::{io, mem};
|
|||
|
||||
use anyhow::{anyhow, bail};
|
||||
use libc::{ELOOP, O_NOFOLLOW};
|
||||
use log::{error, warn};
|
||||
use log::{error, trace, warn};
|
||||
use std::os::unix::fs::{MetadataExt, PermissionsExt};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
|
@ -257,9 +257,11 @@ impl FileAccess {
|
|||
pub async fn getattr(&self, vnode: VnodeId) -> anyhow::Result<DataResponse<FileMetadata>> {
|
||||
let inode_map = self.client_state.inode_map.read().await;
|
||||
if let Some(inode_info) = inode_map.get(vnode.0 as usize) {
|
||||
Ok(self
|
||||
let result = self
|
||||
.read_metadata(&inode_info.real_path, vnode)
|
||||
.await
|
||||
.await;
|
||||
trace!("getattr. Inode {:?} Path: {:?} = {:?}", vnode.0, inode_info.real_path, result);
|
||||
Ok(result
|
||||
.map_or_else(
|
||||
|err| io_error_to_response(err, ENOENT, "getattr"),
|
||||
|fm| DataResponse::Success(fm),
|
||||
|
|
Loading…
Reference in New Issue