From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id 7FA703858D3C; Fri, 11 Mar 2022 10:11:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FA703858D3C Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/release/2.35/master] io: Add fsync call in tst-stat X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/release/2.35/master X-Git-Oldrev: e30c1c73da3f220f5bf0063a1d0344f8280311e7 X-Git-Newrev: 3149f47b808288ccfbf4e56234bc07bdae139708 Message-Id: <20220311101113.7FA703858D3C@sourceware.org> Date: Fri, 11 Mar 2022 10:11:13 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Mar 2022 10:11:13 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3149f47b808288ccfbf4e56234bc07bdae139708 commit 3149f47b808288ccfbf4e56234bc07bdae139708 Author: Florian Weimer Date: Mon Feb 28 11:50:41 2022 +0100 io: Add fsync call in tst-stat 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) Diff: --- io/tst-stat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/io/tst-stat.c b/io/tst-stat.c index 2b7975e162..237988203a 100644 --- a/io/tst-stat.c +++ b/io/tst-stat.c @@ -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");