postgresql/src
Peter Eisentraut d36b728949 Fix handling of copy_file_range() return value
Treat copy_file_range() return value of zero as an error: it indicates
that no bytes could be copied (perhaps the source file is shorter than
expected), and the existing retry loop would otherwise spin forever
since nwritten would never reach BLCKSZ.

The other uses of copy_file_range() in the tree don't have this
problem.

Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Yingying Chen <cyy9255@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/3208cf7a-c7f3-41eb-92f6-33cbeff4df40%40eisentraut.org
2026-06-29 13:01:57 +02:00
..
backend Avoid collation lookup failure when considering a "char" column. 2026-06-28 12:31:29 -04:00
bin Fix handling of copy_file_range() return value 2026-06-29 13:01:57 +02:00
common Fix off-by-one with NFC recomposition for Hangul U+11A7 (TBASE) 2026-06-05 07:50:12 +09:00
fe_utils psql: Fix expanded aligned output 2026-06-08 14:37:56 +09:00
include Avoid ABI break in ModifyTableState from the FDW pruning fix 2026-06-25 12:15:02 +09:00
interfaces Fix null-pointer crash in ECPG compiler. 2026-06-25 16:58:29 -04:00
makefiles pgxs.mk: remove unreachable rule for deleting regress.def. 2025-06-20 12:12:29 -04:00
pl plpython: Fix NULL pointer dereferences for broken sequence and mapping objects 2026-06-29 11:39:50 +09:00
port Make pg_mkdir_p() tolerant of a concurrent directory creation. 2026-06-19 12:52:00 -04:00
template thread-safety: gmtime_r(), localtime_r() 2024-08-23 07:43:04 +02:00
test Re-introduce pgstat_drop_entry(), keeping ABI compatibility 2026-06-23 07:58:04 +09:00
timezone Guard against unsafe conditions in usage of pg_strftime(). 2026-05-11 05:13:47 -07:00
tools Modernize pg_bsd_indent's error/warning reporting code. 2026-06-15 12:22:55 -04:00
tutorial Doc: simplify the tutorial's window-function examples. 2025-01-21 14:43:21 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Don't put library-supplied -L/-I switches before user-supplied ones. 2025-07-29 15:17:40 -04:00
Makefile.shlib Use exported symbols list on macOS for loadable modules as well 2025-06-10 07:04:43 +02:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00