Skip to content

8375294: (fs) Files.copy can fail with EOPNOTSUPP when copy_file_range not supported#2801

Open
judovana wants to merge 2 commits intoopenjdk:masterfrom
judovana:backport-judovana-30cda000-master
Open

8375294: (fs) Files.copy can fail with EOPNOTSUPP when copy_file_range not supported#2801
judovana wants to merge 2 commits intoopenjdk:masterfrom
judovana:backport-judovana-30cda000-master

Conversation

@judovana
Copy link
Copy Markdown
Contributor

@judovana judovana commented Apr 1, 2026

Hi all,

This pull request contains a backport of commit 30cda000 from the openjdk/jdk repository.

The commit being backported was authored by Brian Burkhalter on 15 Jan 2026 and was reviewed by Alan Bateman and Jaikiran Pai.

Thanks!

This backport was clean, except of the copyright header.
Compared to clean backport to jdk25 and 26, jdk21 is missng

As per myself, they are not necessary for this PR to do what it should. If you want any of them to go with/before/after, let me know


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8375294 needs maintainer approval

Error

 ⚠️ Pull request body is missing required line: - [x] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).

Issue

  • JDK-8375294: (fs) Files.copy can fail with EOPNOTSUPP when copy_file_range not supported (Bug - P4 - Requested)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/2801/head:pull/2801
$ git checkout pull/2801

Update a local copy of the PR:
$ git checkout pull/2801
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/2801/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2801

View PR using the GUI difftool:
$ git pr show -t 2801

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/2801.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Apr 1, 2026

👋 Welcome back jvanek! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 1, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title Backport 30cda00010888b6e9a2bf8cdeaedbb3eb4b6a222 8375294: (fs) Files.copy can fail with EOPNOTSUPP when copy_file_range not supported Apr 1, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 1, 2026

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required labels Apr 1, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 1, 2026

⚠️ @judovana This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 1, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Apr 1, 2026

Webrevs

@judovana
Copy link
Copy Markdown
Contributor Author

judovana commented Apr 1, 2026

/approval request Hard to reproduce issue happening after upgrading to jdk 21 from jdk17 in OpenShift with CNSA persistent storage when accessing data stored on GPFS was tracked to the backported patch

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 1, 2026

@judovana
8375294: The approval request has been created successfully.

@openjdk openjdk bot added the approval Requires approval; will be removed when approval is received label Apr 1, 2026
@judovana
Copy link
Copy Markdown
Contributor Author

judovana commented Apr 7, 2026

Hi all,

This pull request contains a backport of commit 30cda000 from the openjdk/jdk repository.

The commit being backported was authored by Brian Burkhalter on 15 Jan 2026 and was reviewed by Alan Bateman and Jaikiran Pai.

Thanks!

This backport was clean, except of the copyright header. Compared to clean backport to jdk25 and 26, jdk21 is missng

As per myself, they are not necessary for this PR to do what it should. If you want any of them to go with/before/after, let me know

I was able to get it tested in reproducing environment, and it fixed the issue without any other backports.

@gnu-andrew
Copy link
Copy Markdown
Member

/reviewers 1 reviewer

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 8, 2026

@gnu-andrew
Warning: By issuing the /reviewers command in this clean backport pull request, the reviewers check has now been enabled.
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 1 (with at least 1 Reviewer).

Copy link
Copy Markdown
Member

@gnu-andrew gnu-andrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a regression caused by JDK-8264744 which caused Linux platforms to try copy_file_range first. The effect of this patch is to cause it to return IOS_UNSUPPORTED_CASE from transferFrom0 and to try sendfile64 in the transferTo0 case i.e. what it was doing in 17u and earlier by default. At present, both fail with an IOException. It already uses sendfile64 in the case of EINVAL, ENOSYS and EXDEV so this is just handling an additional error code thrown by some calls.

Backport is clean bar copyright headers and change seems low risk. sendfile64 will be tried in some additional cases, but this was already the case for those back in 17u.

@gnu-andrew
Copy link
Copy Markdown
Member

I'm not sure where you get this list of other changes from - just those that have changed the copyright header? - but they are not necessary for this change.

@judovana
Copy link
Copy Markdown
Contributor Author

judovana commented Apr 9, 2026

I'm not sure where you get this list of other changes from - just those that have changed the copyright header? - but they are not necessary for this change.

Yes, the only manual touch was the copyright header. But when I was setting that, I was curious why. The three enumerated changes are touching the the files. If the surrounding of the patch would be more +-3, it would not be clean, so I considered as worthy to mention. Sorry for confusion.

@openjdk openjdk bot removed the rfr Pull request is ready for review label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval Requires approval; will be removed when approval is received backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required

Development

Successfully merging this pull request may close these issues.

2 participants