File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -59,14 +59,22 @@ impl<F: FileSystem + Sync> Server<F> {
5959 }
6060
6161 #[ cfg( feature = "fusedev" ) ]
62+ /// Send a resend notification message to the kernel via FUSE. This function should be invoked as part of
63+ /// the crash recovery routine. Given that FUSE initialization does not occur again during recovery,
64+ /// the capability to support resend notifications may not be automatically detected. It is the responsibility
65+ /// of the upper layers to verify and persist the kernel's support for this feature upon the initial FUSE setup.
6266 pub fn notify_resend < S : BitmapSlice > (
6367 & self ,
6468 mut w : FuseDevWriter < ' _ , S > ,
6569 ) -> Result < ( ) > {
6670 let mut buffer_writer = w. split_at ( 0 ) . map_err ( Error :: FailedToSplitWriter ) ?;
67- let mut header = OutHeader :: default ( ) ;
68- header. unique = 0 ;
69- header. error = NotifyOpcode :: Resend as i32 ;
71+ let header = {
72+ OutHeader {
73+ unique : 0 ,
74+ error : NotifyOpcode :: Resend as i32 ,
75+ ..Default :: default ( )
76+ }
77+ } ;
7078 buffer_writer
7179 . write_obj ( header)
7280 . map_err ( Error :: FailedToWrite ) ?;
Original file line number Diff line number Diff line change 1- use fuse_backend_rs:: transport:: FuseDevWriter ;
2- use fuse_backend_rs:: transport:: Writer ;
31use log:: { error, info, warn, LevelFilter } ;
42use std:: env;
53use std:: fs;
@@ -13,7 +11,6 @@ use signal_hook::{consts::TERM_SIGNALS, iterator::Signals};
1311use fuse_backend_rs:: api:: { server:: Server , Vfs , VfsOptions } ;
1412use fuse_backend_rs:: passthrough:: { Config , PassthroughFs } ;
1513use fuse_backend_rs:: transport:: { FuseChannel , FuseSession } ;
16- use std:: os:: unix:: io:: { AsRawFd , FromRawFd , RawFd } ;
1714
1815use simple_logger:: SimpleLogger ;
1916
@@ -63,7 +60,9 @@ impl Daemon {
6360 se. mount ( ) . unwrap ( ) ;
6461
6562 se. with_writer ( |writer| {
66- self . server . notify_resend ( writer) . unwrap ( ) ;
63+ self . server
64+ . notify_resend ( writer)
65+ . unwrap_or_else ( |e| println ! ( "failed to send resend notification {}" , e) ) ;
6766 } ) ;
6867
6968 for _ in 0 ..self . thread_cnt {
You can’t perform that action at this time.
0 commit comments