daemon/fstrim.c: Issue sync_disks after fstrim

Thanks: Eric Sandeen
This commit is contained in:
Richard W.M. Jones
2025-04-25 15:24:43 +01:00
parent 4d5fe341c7
commit e127edcafc

View File

@@ -116,5 +116,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;
}