From 64f127befe1bf70021d46b87ba286483a9b9a4f0 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Sat, 18 Apr 2026 18:07:24 +0100 Subject: [PATCH] Add JDK-8375294 EOPNOTSUPP patch ahead of 21.0.13 Resolves: RHEL-169616 --- java-21-openjdk.spec | 7 ++- jdk8375294-handle-EOPNOTSUPP-in-copying.patch | 47 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 jdk8375294-handle-EOPNOTSUPP-in-copying.patch diff --git a/java-21-openjdk.spec b/java-21-openjdk.spec index 08150a1..c824aa3 100644 --- a/java-21-openjdk.spec +++ b/java-21-openjdk.spec @@ -1447,7 +1447,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 ############################################# # @@ -1924,6 +1925,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 @@ -2576,6 +2579,7 @@ cjc.mainProgram(args) - Bump giflib version to 6.1.2 following JDK-8379256 & JDK-8380078 - Bump libpng version to 1.6.57 following JDK-8380959 & JDK-8382047 - Bump zlib version to 1.3.2 following JDK-8378631 +- Add JDK-8375294 EOPNOTSUPP patch ahead of 21.0.13 - ** This tarball is embargoed until 2026-04-21 @ 1pm PT. ** - Resolves: RHEL-169609 - Resolves: RHEL-133293 @@ -2585,6 +2589,7 @@ cjc.mainProgram(args) - Resolves: RHEL-157141 - Resolves: RHEL-161305 - Resolves: RHEL-161454 +- Resolves: RHEL-169616 * Wed Feb 18 2026 Andrew Hughes - 1:21.0.10.0.7-2 - Bump rpmrelease for CentOS build diff --git a/jdk8375294-handle-EOPNOTSUPP-in-copying.patch b/jdk8375294-handle-EOPNOTSUPP-in-copying.patch new file mode 100644 index 0000000..60af1fd --- /dev/null +++ b/jdk8375294-handle-EOPNOTSUPP-in-copying.patch @@ -0,0 +1,47 @@ +diff --git a/src/java.base/linux/native/libnio/ch/FileDispatcherImpl.c b/src/java.base/linux/native/libnio/ch/FileDispatcherImpl.c +index 207e61431dc..7c3761a613c 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, 2022, 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 cf8592e1ced..5f14896ad24 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, 2022, 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 +@@ -199,6 +199,7 @@ Java_sun_nio_fs_LinuxNativeDispatcher_directCopy0 + case EINVAL: + case ENOSYS: + case EXDEV: ++ case EOPNOTSUPP: + // ignore and try sendfile() + break; + default: