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 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0c1b750
refactor: fix rebase problem
unknowntpo Jan 3, 2025
69d42b3
fix(fuse:filesystem.rs): wip: add Debug trait to FileSystemContext
unknowntpo Dec 18, 2024
8f72e80
feat: implement FuseApiHandleDebug
unknowntpo Dec 19, 2024
f590645
fix rebase error
unknowntpo Dec 19, 2024
9ffd0bf
revert unnecesary change
unknowntpo Dec 19, 2024
d67ec87
fix(gvfs/fuse_test.rs): should use tracing_subscriber::fmt::init()
unknowntpo Dec 28, 2024
23f1fd5
feat(gvfs_fuse::fuse_api_handle): tweak log
unknowntpo Dec 28, 2024
d157e0e
feat(gvfs_fuse::fuse_api_handle): tweak log, add debugging message fo…
unknowntpo Dec 28, 2024
f1913b8
feat(gvfs_fuse::fuse_api_handle): add TimestampDebug, FileAttrDebug t…
unknowntpo Dec 28, 2024
efc7e50
feat(gvfs_fuse::fuse_api_handle): improve debug message for get_modif…
unknowntpo Dec 29, 2024
ef4fc64
feat(gvfs_fuse::fuse_api_handle): log file_stat in getattr
unknowntpo Dec 29, 2024
eeaf785
feat(gvfs_fuse::fuse_api_handle): tweak logging format of Timestamp i…
unknowntpo Dec 29, 2024
c6d2c31
styles: apply cargo fmt
unknowntpo Dec 29, 2024
77a1edd
minor: apply formatting
unknowntpo Jan 3, 2025
aaa1ddc
refactor: extract FuseApiHandleDebug to new file
unknowntpo Jan 3, 2025
b0e7259
refactor: tweak gvfs_fuse.rs due to rebase
unknowntpo Jan 3, 2025
a75ee45
refactor: implement timestamp_to_readable_time_string
unknowntpo Jan 3, 2025
41a1837
docs(fuse_api_handle_debug): add doc of timestamp_to_readable_time_st…
unknowntpo Jan 7, 2025
e27b8e3
refactor: use error! to log message if result is Err
unknowntpo Jan 7, 2025
91ee971
wip: use structure logging with tracing pacakge
unknowntpo Jan 8, 2025
ae9341b
feat: show file / dir name in log
unknowntpo Jan 9, 2025
0256bc9
feat: show file / dir name in log
unknowntpo Jan 10, 2025
2dd85cc
refactor: rename Timestamp formatting function
unknowntpo Jan 10, 2025
90bb633
feat: implement reply_attr_to_desc_str
unknowntpo Jan 10, 2025
d20fef4
refactor: remove FileAttrDebug
unknowntpo Jan 10, 2025
87e01ff
feat: implement string format method for ReplyEntry, ReplyCreated
unknowntpo Jan 10, 2025
9acdc4c
style(: format the code
unknowntpo Jan 10, 2025
ef22880
refactor: remove unused import
unknowntpo Jan 10, 2025
3038447
refactor: skip clippy::needless_lifetimes check
unknowntpo Jan 10, 2025
03a6e3f
style(Cargo.toml): sort deps
unknowntpo Jan 10, 2025
22a3ad3
refactor: show permission in octal format
unknowntpo Jan 14, 2025
c1499ca
refactor: use reply_entry_to_desc_str in lookup
unknowntpo Jan 14, 2025
83012c3
feat(fuse/gvfs_fuse.rs): make FileApiHandleDebug optional, controlled…
unknowntpo Jan 15, 2025
5959837
refactor(fuse_api_handle.rs): remove unnecessary debug!
unknowntpo Jan 15, 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"
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

[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)]
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
15 changes: 8 additions & 7 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,
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 @@ -106,7 +106,7 @@ impl<T: RawFileSystem> Filesystem for FuseApiHandle<T> {

async fn getattr(
&self,
_req: Request,
req: Request,
inode: Inode,
fh: Option<u64>,
_flags: u32,
Expand All @@ -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