File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ impl Component for Efi {
291291 log:: trace!( "applying adoption diff: {}" , & diff) ;
292292 filetree:: apply_diff ( & updated, & esp, & diff, None )
293293 . context ( "applying filesystem changes" ) ?;
294+ run_sync ( ) ?;
294295 self . unmount ( ) . context ( "unmount after adopt" ) ?;
295296 }
296297 Ok ( InstalledContent {
@@ -380,6 +381,7 @@ impl Component for Efi {
380381 log:: trace!( "applying diff: {}" , & diff) ;
381382 filetree:: apply_diff ( & updated, & destdir, & diff, None )
382383 . context ( "applying filesystem changes" ) ?;
384+ run_sync ( ) ?;
383385 self . unmount ( ) . context ( "unmount after update" ) ?;
384386 }
385387 let adopted_from = None ;
@@ -497,6 +499,15 @@ impl Drop for Efi {
497499 }
498500}
499501
502+ // Run sync after apply_diff()
503+ fn run_sync ( ) -> Result < ( ) > {
504+ Command :: new ( "sync" )
505+ . run ( )
506+ . with_context ( || format ! ( "Failed to run sync" ) ) ?;
507+ log:: trace!( "Sync" ) ;
508+ Ok ( ( ) )
509+ }
510+
500511fn validate_esp_fstype ( dir : & openat:: Dir ) -> Result < ( ) > {
501512 let dir = unsafe { BorrowedFd :: borrow_raw ( dir. as_raw_fd ( ) ) } ;
502513 let stat = rustix:: fs:: fstatfs ( & dir) ?;
You can’t perform that action at this time.
0 commit comments