From: Michael Paquier Date: Thu, 30 Apr 2026 09:44:41 +0000 (+0900) Subject: Fix errno check based on EINTR in pg_flush_data() X-Git-Tag: REL_18_4~39 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=6cb307251c5c6261286c1566496920976640108e;p=thirdparty%2Fpostgresql.git Fix errno check based on EINTR in pg_flush_data() Upon a failure of sync_file_range(), EINTR was checked based on the returned result of the routine rather than its errno. sync_file_range() returns -1 on failure, making the check a no-op, invalidating the retry attempt in this case. Oversight in 0d369ac65004. Author: DaeMyung Kang Discussion: https://postgr.es/m/20260429151811.1810874-1-charsyam@gmail.com Backpatch-through: 16 --- diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index 73fa05278a3..378c078c7c7 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -562,7 +562,7 @@ retry: { int elevel; - if (rc == EINTR) + if (errno == EINTR) goto retry; /*