Re: pg_upgrade --copy-file-range fails with EINVAL on Linux 4.19

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: 达劳里亚斯 <ihaveabigdoor(at)gmail(dot)com>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgrade --copy-file-range fails with EINVAL on Linux 4.19
Date: 2026-08-26 15:39:48
Message-ID: 2974dfa8-4abf-4012-bc1b-a093a542100d@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23.08.26 13:54, 达劳里亚斯 wrote:
> Here is a patch for option (4): do not define HAVE_COPY_FILE_RANGE
> when building against Linux kernel headers older than 5.3.

This approach is not correct. You don't know whether the kernel you are
running against is the one you built against. Most likely it is not.

I think a possible correct approach would be to somehow do this check in
the pg_upgrade --check phase.

But maybe nothing needs to be done. You get a clean error return if
what you are doing is not supported by copy_file_range(), so that seems ok?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2026-08-26 15:53:23 Re: Allow table AMs to define their own reloptions
Previous Message Aleksander Alekseev 2026-08-26 15:27:10 Re: [PATCH] Add tests for src/backend/nodes/extensible.c