diff --git a/daemon/fstrim.c b/daemon/fstrim.c index 06707a7fb..474ef72d0 100644 --- a/daemon/fstrim.c +++ b/daemon/fstrim.c @@ -127,5 +127,13 @@ do_fstrim (const char *path, if (verbose) fprintf (stderr, "%s\n", out); + /* Sync the disks again. In practice we always call fstrim + * expecting that afterwards the results are visible in the qemu + * devices backing the guest. Depending on the Linux filesystem, + * fstrim may issue asynch discard requests, so it's not necessarily + * true that everything has been written out before this point. + */ + sync_disks (); + return 0; }