From e0c4fe411016bb03304d666aa8113e6f0c330cd4 Mon Sep 17 00:00:00 2001 From: "Justin Terry (VM)" Date: Wed, 22 May 2019 13:31:58 -0700 Subject: [PATCH] Forcibly sync writes on lcow layer.vhd after write Signed-off-by: Justin Terry (VM) --- diff/lcow/lcow.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/diff/lcow/lcow.go b/diff/lcow/lcow.go index 6ac42ed6b..29e7e5def 100644 --- a/diff/lcow/lcow.go +++ b/diff/lcow/lcow.go @@ -152,7 +152,11 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou err = tar2ext4.Convert(rc, outFile, tar2ext4.ConvertWhiteout, tar2ext4.AppendVhdFooter, tar2ext4.MaximumDiskSize(maxLcowVhdSizeGB)) if err != nil { - return emptyDesc, errors.Wrapf(err, "failed to convert tar to ext4 vhd") + return emptyDesc, errors.Wrapf(err, "failed to convert tar2ext4 vhd") + } + err = outFile.Sync() + if err != nil { + return emptyDesc, errors.Wrapf(err, "failed to sync tar2ext4 vhd to disk") } outFile.Close()