RFR: 8272047: java/nio/channels/FileChannel/Transfer2GPlus.java failed with Unexpected transfer size: 2147418112
Brian Burkhalter
bpb at openjdk.java.net
Thu Aug 5 23:33:33 UTC 2021
On Thu, 5 Aug 2021 23:26:44 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> On Linux the `transferTo()` method uses `sendfile()` for the code in question. The specification of [sendfile()](https://man7.org/linux/man-pages/man2/sendfile.2.html) states that it will transfer at most `0x7ffff000` (`LINUX_MAX_TRANSFER_SIZE`) bytes. So here we are only checking for an aberration which is not essential to the test. The important content is when `transferTo()` is supposed to actually copy the full length in one shot. This Linux part of the test is just a drive-by sanity check.
>
> Thanks for the explanation. Then I would think adding the same check in the loop for consistency, i.e., check the transferred size `n` in one shot is no more than `LINUX_MAX_TRANSFER_SIZE` after line 98.
I can do that. Thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5025
More information about the nio-dev
mailing list