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

Properly handle errors from the fuse device. #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 2 additions & 4 deletions src/transport/fusedev/linux_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ impl FuseChannel {
}

for event in events.iter() {
if event.is_readable() {
// We will handle errors when reading from the fuse device
if event.is_readable() || event.is_error() {
match event.token() {
EXIT_FUSE_EVENT => need_exit = true,
FUSE_DEV_EVENT => fusereq_available = true,
Expand All @@ -350,9 +351,6 @@ impl FuseChannel {
return Err(SessionFailure(format!("unexpected epoll event: {}", x.0)));
}
}
} else if event.is_error() {
info!("FUSE channel already closed!");
return Err(SessionFailure("epoll error".to_string()));
} else {
// We should not step into this branch as other event is not registered.
panic!("unknown epoll result events");
Expand Down