Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#5873] feat(gvfs-fuse): add debug log for FuseApiHandle #5905

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
73a0ac0
refactor: fix rebase problem
unknowntpo Jan 3, 2025
b7a8091
fix(fuse:filesystem.rs): wip: add Debug trait to FileSystemContext
unknowntpo Dec 18, 2024
c2372d0
feat: implement FuseApiHandleDebug
unknowntpo Dec 19, 2024
9223f81
fix rebase error
unknowntpo Dec 19, 2024
b174ab5
revert unnecesary change
unknowntpo Dec 19, 2024
718b962
fix(gvfs/fuse_test.rs): should use tracing_subscriber::fmt::init()
unknowntpo Dec 28, 2024
ee99b73
feat(gvfs_fuse::fuse_api_handle): tweak log
unknowntpo Dec 28, 2024
1c4b969
feat(gvfs_fuse::fuse_api_handle): tweak log, add debugging message fo…
unknowntpo Dec 28, 2024
27892b4
feat(gvfs_fuse::fuse_api_handle): add TimestampDebug, FileAttrDebug t…
unknowntpo Dec 28, 2024
5a270a8
feat(gvfs_fuse::fuse_api_handle): improve debug message for get_modif…
unknowntpo Dec 29, 2024
b0b25d9
feat(gvfs_fuse::fuse_api_handle): log file_stat in getattr
unknowntpo Dec 29, 2024
f7acf2c
feat(gvfs_fuse::fuse_api_handle): tweak logging format of Timestamp i…
unknowntpo Dec 29, 2024
d2d5777
styles: apply cargo fmt
unknowntpo Dec 29, 2024
e056cc8
minor: apply formatting
unknowntpo Jan 3, 2025
6cea44d
refactor: extract FuseApiHandleDebug to new file
unknowntpo Jan 3, 2025
131e1e1
refactor: tweak gvfs_fuse.rs due to rebase
unknowntpo Jan 3, 2025
56ee508
refactor: implement timestamp_to_readable_time_string
unknowntpo Jan 3, 2025
cb4cbc9
docs(fuse_api_handle_debug): add doc of timestamp_to_readable_time_st…
unknowntpo Jan 7, 2025
ffab5c3
refactor: use error! to log message if result is Err
unknowntpo Jan 7, 2025
80ec9fb
wip: use structure logging with tracing pacakge
unknowntpo Jan 8, 2025
8d61983
feat: show file / dir name in log
unknowntpo Jan 9, 2025
bf36665
feat: show file / dir name in log
unknowntpo Jan 10, 2025
8a1897f
refactor: rename Timestamp formatting function
unknowntpo Jan 10, 2025
609bf62
feat: implement reply_attr_to_desc_str
unknowntpo Jan 10, 2025
90a9d8c
refactor: remove FileAttrDebug
unknowntpo Jan 10, 2025
006e72d
feat: implement string format method for ReplyEntry, ReplyCreated
unknowntpo Jan 10, 2025
e943183
style(: format the code
unknowntpo Jan 10, 2025
dd40f05
refactor: remove unused import
unknowntpo Jan 10, 2025
a0f4e65
refactor: skip clippy::needless_lifetimes check
unknowntpo Jan 10, 2025
c30e1ab
style(Cargo.toml): sort deps
unknowntpo Jan 10, 2025
c255270
refactor: show permission in octal format
unknowntpo Jan 14, 2025
72734a5
refactor: use reply_entry_to_desc_str in lookup
unknowntpo Jan 14, 2025
0b240ce
feat(fuse/gvfs_fuse.rs): make FileApiHandleDebug optional, controlled…
unknowntpo Jan 15, 2025
58ab18b
refactor(fuse_api_handle.rs): remove unnecessary debug!
unknowntpo Jan 15, 2025
ed83eec
feat(fuse/gvfs_fuse.rs): make FileApiHandleDebug optional, controlled…
unknowntpo Jan 15, 2025
829c285
refactor(fuse_api_handle.rs): getattr: rename req to _req
unknowntpo Jan 15, 2025
00612cc
wip: add log_result macro
unknowntpo Jan 15, 2025
5b4110a
feat(fuse_api_handle_debug): use log_result! macro to simplify boiler…
unknowntpo Jan 15, 2025
3396487
doc(fuse_api_handle_debug): add doc for log_result
unknowntpo Jan 16, 2025
8f4615f
refactor: perm
unknowntpo Jan 16, 2025
72aefd8
MINOR: remove accidentally committed src/mount.rs
unknowntpo Jan 16, 2025
5bc0031
MINOR: remove unnecessary white space
unknowntpo Jan 16, 2025
c1513e3
MINOR: rename variable _fs to fs
unknowntpo Jan 16, 2025
2ee68cf
doc: ignore doc test for log_result!
unknowntpo Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clients/filesystem-fuse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ name = "gvfs_fuse"
[dependencies]
async-trait = "0.1"
bytes = "1.6.0"
chrono = "0.4.39"
config = "0.13"
dashmap = "6.1.0"
fuse3 = { version = "0.8.1", "features" = ["tokio-runtime", "unprivileged"] }
Expand All @@ -46,6 +47,7 @@ opendal = { version = "0.46.0", features = ["services-s3"] }
reqwest = { version = "0.12.9", features = ["json"] }
serde = { version = "1.0.216", features = ["derive"] }
tokio = { version = "1.38.0", features = ["full"] }
tracing = "0.1.41"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to use tracing instead of log, please remove log.

tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
urlencoding = "2.1.3"

Expand Down
1 change: 1 addition & 0 deletions clients/filesystem-fuse/conf/gvfs_fuse.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
file_mask = 0o600
dir_mask = 0o700
fs_type = "memory"
fuse_debug=true

Copy link
Contributor

@diqiu50 diqiu50 Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the format

[fuse.properties]

Expand Down
2 changes: 2 additions & 0 deletions clients/filesystem-fuse/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ pub struct FuseConfig {
#[serde(default)]
pub fs_type: String,
#[serde(default)]
pub fuse_debug: bool,
#[serde(default)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to handle default value like other configurations.

pub config_path: String,
#[serde(default)]
pub properties: HashMap<String, String>,
Expand Down
1 change: 1 addition & 0 deletions clients/filesystem-fuse/src/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ pub(crate) trait PathFileSystem: Send + Sync {
}

// FileSystemContext is the system environment for the fuse file system.
#[derive(Debug)]
pub(crate) struct FileSystemContext {
// system user id
pub(crate) uid: u32,
Expand Down
13 changes: 7 additions & 6 deletions clients/filesystem-fuse/src/fuse_api_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl<T: RawFileSystem> FuseApiHandle<T> {
}
}

async fn get_modified_file_stat(
pub async fn get_modified_file_stat(
&self,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use this function to retrieve the file name. use the RawFileSystem::get_file_path

file_id: u64,
size: Option<u64>,
Expand All @@ -64,15 +64,15 @@ impl<T: RawFileSystem> FuseApiHandle<T> {

if let Some(size) = size {
file_stat.size = size;
};
}

if let Some(atime) = atime {
file_stat.atime = atime;
};
}

if let Some(mtime) = mtime {
file_stat.mtime = mtime;
};
}

Ok(file_stat)
}
Expand Down Expand Up @@ -117,6 +117,7 @@ impl<T: RawFileSystem> Filesystem for FuseApiHandle<T> {
}

let file_stat = self.fs.stat(inode).await?;

Ok(ReplyAttr {
ttl: self.default_ttl,
attr: fstat_to_file_attr(&file_stat, &self.fs_context),
Expand Down Expand Up @@ -256,7 +257,7 @@ impl<T: RawFileSystem> Filesystem for FuseApiHandle<T> {
}

type DirEntryStream<'a>
= BoxStream<'a, fuse3::Result<DirectoryEntry>>
= BoxStream<'a, fuse3::Result<DirectoryEntry>>
where
T: 'a;

Expand Down Expand Up @@ -336,7 +337,7 @@ impl<T: RawFileSystem> Filesystem for FuseApiHandle<T> {
}

type DirEntryPlusStream<'a>
= BoxStream<'a, fuse3::Result<DirectoryEntryPlus>>
= BoxStream<'a, fuse3::Result<DirectoryEntryPlus>>
where
T: 'a;

Expand Down
Loading
Loading