File tree 2 files changed +14
-7
lines changed
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> {
59
59
}
60
60
61
61
#[ 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.
62
66
pub fn notify_resend < S : BitmapSlice > (
63
67
& self ,
64
68
mut w : FuseDevWriter < ' _ , S > ,
65
69
) -> Result < ( ) > {
66
70
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
+ } ;
70
78
buffer_writer
71
79
. write_obj ( header)
72
80
. 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 ;
3
1
use log:: { error, info, warn, LevelFilter } ;
4
2
use std:: env;
5
3
use std:: fs;
@@ -13,7 +11,6 @@ use signal_hook::{consts::TERM_SIGNALS, iterator::Signals};
13
11
use fuse_backend_rs:: api:: { server:: Server , Vfs , VfsOptions } ;
14
12
use fuse_backend_rs:: passthrough:: { Config , PassthroughFs } ;
15
13
use fuse_backend_rs:: transport:: { FuseChannel , FuseSession } ;
16
- use std:: os:: unix:: io:: { AsRawFd , FromRawFd , RawFd } ;
17
14
18
15
use simple_logger:: SimpleLogger ;
19
16
@@ -63,7 +60,9 @@ impl Daemon {
63
60
se. mount ( ) . unwrap ( ) ;
64
61
65
62
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) ) ;
67
66
} ) ;
68
67
69
68
for _ in 0 ..self . thread_cnt {
You can’t perform that action at this time.
0 commit comments