Skip to content

Commit

Permalink
Optimize log output and print in vfs umount scenario
Browse files Browse the repository at this point in the history
1. optimize the log of forget, for scenarios where forget cannot handle
when the vfs submount is dropped by umount.
2. remove the error log printed when write fuse fails, and hand it to
the caller to process and print.

Signed-off-by: zyfjeff <[email protected]>
  • Loading branch information
zyfjeff committed Sep 21, 2023
1 parent 99ba31f commit b3c4741
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/api/vfs/sync_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,15 @@ impl FileSystem for Vfs {
(Right(fs), idata) => fs.forget(ctx, idata.ino(), count),
},
Err(e) => {
error!("vfs::forget: failed to get_real_rootfs {:?}", e);
// When a directory is umount and invalidate entry, a forget request is triggered,
// which cannot be forwarded to the backend file system.
// this situation is reasonable, so it is changed to warn here
warn!(
"vfs::forget: failed to get_real_rootfs {:?}, inode: {:?},
maybe it is possible that the vfs submount was dropped by umount,
which is reasonable.",
e, inode
);
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/transport/fusedev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ impl<'a, S: BitmapSlice> FuseDevWriter<'a, S> {
}
};

res.map_err(|e| {
error! {"fail to write to fuse device on commit: {}", e};
io::Error::from_raw_os_error(e as i32)
})
res.map_err(|e| io::Error::from_raw_os_error(e as i32))
}

/// Return number of bytes already written to the internal buffer.
Expand Down

0 comments on commit b3c4741

Please sign in to comment.