From 4e62176a93056ca1572b536df44b5aff5d0f2dc8 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Sat, 18 Apr 2026 17:47:21 +0100 Subject: [PATCH] Add JDK-8375294 EOPNOTSUPP patch ahead of 25.0.4 Resolves: RHEL-169613 --- java-25-openjdk.spec | 7 ++- jdk8375294-handle-EOPNOTSUPP-in-copying.patch | 63 +++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 jdk8375294-handle-EOPNOTSUPP-in-copying.patch diff --git a/java-25-openjdk.spec b/java-25-openjdk.spec index c335e32..0b3e115 100644 --- a/java-25-openjdk.spec +++ b/java-25-openjdk.spec @@ -1390,7 +1390,8 @@ Patch1001: fips-%{featurever}u-%{fipsver}.patch # ############################################# -# Currently empty +# JDK-8375294: (fs) Files.copy can fail with EOPNOTSUPP when copy_file_range not supported +Patch2001: jdk8375294-handle-EOPNOTSUPP-in-copying.patch ############################################# # @@ -1925,6 +1926,8 @@ sh %{SOURCE12} %{top_level_dir_name} pushd %{top_level_dir_name} # Add crypto policy and FIPS support %patch -P1001 -p1 +# Add EOPNOTSUPP patch +%patch -P2001 -p1 popd # openjdk # Patch NSS adapter @@ -2610,11 +2613,13 @@ exit 0 - Bump libpng version to 1.6.57 following JDK-8380959 & JDK-8382047 - Bump zlib version to 1.3.2 following JDK-8378631 - Bump tzdata version to 2026a following JDK-8379035 +- Add JDK-8375294 EOPNOTSUPP patch ahead of 25.0.4 - ** This tarball is embargoed until 2026-04-21 @ 1pm PT. ** - Resolves: RHEL-169620 - Resolves: RHEL-157091 - Resolves: RHEL-161217 - Resolves: RHEL-161333 +- Resolves: RHEL-169613 * Thu Mar 12 2026 Andrew Hughes - 1:25.0.2.0.10-4 - Add tagging scripts with signature checks and gating handling diff --git a/jdk8375294-handle-EOPNOTSUPP-in-copying.patch b/jdk8375294-handle-EOPNOTSUPP-in-copying.patch new file mode 100644 index 0000000..ea8076a --- /dev/null +++ b/jdk8375294-handle-EOPNOTSUPP-in-copying.patch @@ -0,0 +1,63 @@ +From dbbdc1dffd10608195487fa139e77c4a90c80658 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Van=C4=9Bk?= +Date: Wed, 15 Apr 2026 12:54:49 +0000 +Subject: [PATCH] 8375294: (fs) Files.copy can fail with EOPNOTSUPP when + copy_file_range not supported + +Reviewed-by: andrew +Backport-of: 30cda00010888b6e9a2bf8cdeaedbb3eb4b6a222 +--- + src/java.base/linux/native/libnio/ch/FileDispatcherImpl.c | 5 +++-- + src/java.base/linux/native/libnio/fs/LinuxNativeDispatcher.c | 3 ++- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/java.base/linux/native/libnio/ch/FileDispatcherImpl.c b/src/java.base/linux/native/libnio/ch/FileDispatcherImpl.c +index efbd0ca5684..54d640b03a4 100644 +--- a/src/java.base/linux/native/libnio/ch/FileDispatcherImpl.c ++++ b/src/java.base/linux/native/libnio/ch/FileDispatcherImpl.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -63,7 +63,7 @@ Java_sun_nio_ch_FileDispatcherImpl_transferFrom0(JNIEnv *env, jobject this, + if (n < 0) { + if (errno == EAGAIN) + return IOS_UNAVAILABLE; +- if (errno == ENOSYS) ++ if (errno == ENOSYS || errno == EOPNOTSUPP) + return IOS_UNSUPPORTED_CASE; + if ((errno == EBADF || errno == EINVAL || errno == EXDEV) && + ((ssize_t)count >= 0)) +@@ -103,6 +103,7 @@ Java_sun_nio_ch_FileDispatcherImpl_transferTo0(JNIEnv *env, jobject this, + case EINVAL: + case ENOSYS: + case EXDEV: ++ case EOPNOTSUPP: + // ignore and try sendfile() + break; + default: +diff --git a/src/java.base/linux/native/libnio/fs/LinuxNativeDispatcher.c b/src/java.base/linux/native/libnio/fs/LinuxNativeDispatcher.c +index c90e99dda07..4677411b0ba 100644 +--- a/src/java.base/linux/native/libnio/fs/LinuxNativeDispatcher.c ++++ b/src/java.base/linux/native/libnio/fs/LinuxNativeDispatcher.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2008, 2026, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -193,6 +193,7 @@ Java_sun_nio_fs_LinuxNativeDispatcher_directCopy0 + case EINVAL: + case ENOSYS: + case EXDEV: ++ case EOPNOTSUPP: + // ignore and try sendfile() + break; + default: +-- +2.52.0 +