| From: | Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Fix error handling in pg_flush_data() and FilePrefetch() |
| Date: | 2026-10-31 09:48:14 |
| Message-ID: | E1xN5h8-00000001W7S-2gr2@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Fix error handling in pg_flush_data() and FilePrefetch()
posix_fadvise() returns an error code directly instead of setting
errno. However, pg_flush_data() uses %m and errcode_for_file_access()
to report errors without setting errno, potentially reporting an
unrelated error. Fix this by assigning the returned error code to
errno before reporting the error.
FilePrefetch() is documented to return an errno error code on failure,
but it returns -1 when FileAccess() fails. Fix this by returning errno
instead.
The first bug one only affects a warning, and the second doesn't have
any effect because the only existing caller ignores the return value.
So these are pretty harmless bugs, but let's be tidy.
Author: Chao Li <lic(at)highgo(dot)com>
Discussion: https://www.postgresql.org/message-id/F1916C7A-F152-4AF3-87A9-40492D8B3670@gmail.com
Backpatch-through: 14
Branch
------
REL_17_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/ce2797dca4f81bad7e4b838761bf717ceaaa584c
Modified Files
--------------
src/backend/storage/file/fd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Robert Haas | 2026-10-31 10:42:10 | Re: pgsql: Set HEAP_XMAX_INVALID for tuples updated by aborted subtransacti |
| Previous Message | Michael Paquier | 2026-10-31 00:34:27 | Re: pgsql: Set HEAP_XMAX_INVALID for tuples updated by aborted subtransacti |