postgres.git / summary / log / commit / refs
commit 3b35c10a4d503a64a6bc110de3330a337bc1a362
Author: Michael Paquier <michael@paquier.xyz>
Date: Thu Apr 30 09:44:45 2026 +0000
First released in: 16.14, 17.10, 18.4
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 <charsyam@gmail.com>
Discussion: https://postgr.es/m/20260429151811.1810874-1-charsyam@gmail.com
Backpatch-through: 16
src/backend/storage/file/fd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index b54c42d9f84..bf331867457 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -516,7 +516,7 @@ retry:
{
int elevel;
- if (rc == EINTR)
+ if (errno == EINTR)
goto retry;
/*
[parent: 7a8e35a4c964]