From d0a18323474e33d55da201395e3506f81021bce7 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 2 May 2018 11:59:21 -0400 Subject: [PATCH] deploy: Use fdatasync() for new kernel/initramfs by default While we do a `syncfs()` plus `FIFREEZE/THAW` for `/boot`, that only comes during deployment finalization. The code here today generally assumes that if the file exists it's been fully written. So let's do a `fdatasync()` before we do the `rename()`. This just came out of looking through the code while working on deployment staging. In that scenario there's a much larger window between when we copy the kernel/initramfs and when we sync `/boot`. Closes: #1571 Approved by: jlebon --- src/libostree/ostree-sysroot-deploy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index b21be0e9..7830e830 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -128,7 +128,7 @@ install_into_boot (OstreeSePolicy *sepolicy, error)) return FALSE; return glnx_file_copy_at (src_dfd, src_subpath, NULL, dest_dfd, dest_subpath, - GLNX_FILE_COPY_NOXATTRS, + GLNX_FILE_COPY_NOXATTRS | GLNX_FILE_COPY_DATASYNC, cancellable, error); } else