RFR: 8286763: [REDO] (fc) Tune FileChannel.transferFrom()

Brian Burkhalter bpb at openjdk.java.net
Tue May 17 15:31:55 UTC 2022


On Tue, 17 May 2022 06:49:47 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Re-do the fix for [JDK-8274113](https://bugs.openjdk.java.net/browse/JDK-8274113) which was reverted by [JDK-8286677.](https://bugs.openjdk.java.net/browse/JDK-8286677)
>
> src/java.base/unix/native/libnio/ch/FileChannelImpl.c line 281:
> 
>> 279:         if ((errno == EBADF || errno == EINVAL || errno == EXDEV) &&
>> 280:             ((ssize_t)count >= 0))
>> 281:             return IOS_UNSUPPORTED_CASE;
> 
> I don't think you can return IOS_UNSUPPORTED_CASE for the these cases because it will disable the use of copy_file_range for the everyone and all channels. So I think we'll need to think through whether the append and overlap cases where we checked first or return IOS_UNSUPPORTED_CASE does not disable it for everyone. I think the former is probably better.

Isn't it that returning `IOS_UNSUPPORTED` would disable it for everyone? I thought that `IOS_UNSUPPORTED_CASE` allows it to be tried again. Of course one could check for append or overlap in the Java layer instead. I actually had it that way initially for the overlap case but removed it.

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

PR: https://git.openjdk.java.net/jdk/pull/8733


More information about the nio-dev mailing list