RFR: 8337966: (fs) Files.readAttributes fails with Operation not permitted on older docker releases

Alexey Bakhtin abakhtin at openjdk.org
Tue Aug 27 18:31:04 UTC 2024


On Tue, 27 Aug 2024 16:04:02 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> In that case then maybe it's better to not put a workaround into the JDK for this.

I'm not sure it is a workaround. There is a similar code for `copy_file_range` syscall, which checks errno and fallback to `sendfile` in particular cases: https://github.com/openjdk/jdk/blob/master/src/java.base/linux/native/libnio/fs/LinuxNativeDispatcher.c#L189

I suggest to rewrite this PR the same way. Verify `statx` and `copy_file_range` for EPERM error code and fallback to existing alternative implementation.

It may not be so important for the jdk project, but it is critical for `statx` and `copy_file_range` backports to previous jdk versions because it causes regression in a particular environment.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20484#issuecomment-2313241212


More information about the nio-dev mailing list