]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
io: Add fsync call in tst-stat
authorFlorian Weimer <fweimer@redhat.com>
Mon, 28 Feb 2022 10:50:41 +0000 (11:50 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 11 Mar 2022 10:13:33 +0000 (11:13 +0100)
io/tst-stat and io/tst-stat-lfs fail sporadically on the Fedora
builders, and this change hopefully helps to avoid the issue.

(cherry picked from commit ae132284092edc5885315b44cd17d5ea91177e49)

io/tst-stat.c

index 82e965de6ad87f61100283182c57e1e4a4a82aad..be20cf16d70d05cc4e093730b6eb13c0a7dcd8bb 100644 (file)
@@ -69,6 +69,10 @@ do_test (void)
   TEST_VERIFY_EXIT (fd >= 0);
   support_write_file_string (path, "abc");
 
+  /* This should help to prevent delayed allocation, which may result
+     in a spurious stx_blocks/st_blocks difference.  */
+  fsync (fd);
+
   bool check_ns = support_stat_nanoseconds (path);
   if (!check_ns)
     printf ("warning: timestamp with nanoseconds not supported\n");