30 lines
988 B
Diff
30 lines
988 B
Diff
From e9a7378d730477d6a548c18244ba0bde9c7dc93d Mon Sep 17 00:00:00 2001
|
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
Date: Fri, 25 Apr 2025 15:24:43 +0100
|
|
Subject: [PATCH] daemon/fstrim.c: Issue sync_disks after fstrim
|
|
|
|
Thanks: Eric Sandeen
|
|
(cherry picked from commit e127edcafc95c75bf484bf2199eb746a392c58c0)
|
|
---
|
|
daemon/fstrim.c | 8 ++++++++
|
|
1 file changed, 8 insertions(+)
|
|
|
|
diff --git a/daemon/fstrim.c b/daemon/fstrim.c
|
|
index 06707a7f..474ef72d 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;
|
|
}
|