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

Add errno to fuse_error macro #1189

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion mountpoint-s3/src/fuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ macro_rules! event {
macro_rules! fuse_error {
($name:literal, $reply:expr, $err:expr) => {{
let err = $err;
event!(err.level, "{} failed: {:#}", $name, err);
event!(err.level, "{} {} failed: {:#}", $name, err.to_errno(), err);
::metrics::counter!("fuse.op_failures", "op" => $name).increment(1);
$reply.error(err.to_errno());
}};
Expand Down
2 changes: 1 addition & 1 deletion mountpoint-s3/tests/fuse_tests/fork_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ fn read_with_no_permissions_for_a_key_sse() {
read_result.expect("should be able to read a default-encrypted file after the first read failure");
}

let log_line_pattern = format!("^.*WARN.*{encrypted_object}.*read failed: get request failed: get object request failed: Client error: Forbidden: User: .* is not authorized to perform: kms:Decrypt on resource: {key_id} because no session policy allows the kms:Decrypt action.*$");
let log_line_pattern = format!("^.*WARN.*{encrypted_object}.*read 5 failed: get request failed: get object request failed: Client error: Forbidden: User: .* is not authorized to perform: kms:Decrypt on resource: {key_id} because no session policy allows the kms:Decrypt action.*$");
Copy link
Contributor

Choose a reason for hiding this comment

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

The error message does not look right. Why are we adding the error number here?

Copy link
Contributor

Choose a reason for hiding this comment

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

We had a chat, we're probably looking for something like "read failed returning errno 5"

Copy link
Contributor

@dannycjones dannycjones Dec 10, 2024

Choose a reason for hiding this comment

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

It may be worth taking a look at this libc(?) function that can return a string form of the error: https://man7.org/linux/man-pages/man3/errno.3.html. Or maybe we just do something Rust-side.

The idea is if we can instead get to something like:

"read failed returning EPERM"

Copy link
Contributor

Choose a reason for hiding this comment

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

Oops, see we're already working in this PR: #1197

let expected_log_line = regex::Regex::new(&log_line_pattern).unwrap();
unmount_and_check_log(child, mount_point.path(), &expected_log_line);
}
Expand Down
Loading