RFR: 5041655: (ch) FileLock: negative param and overflow issues [v7]
Brian Burkhalter
bpb at openjdk.java.net
Fri Feb 11 01:46:10 UTC 2022
On Thu, 10 Feb 2022 21:01:03 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Add an implementation note to `java.nio.channels.FileLock.overlaps(long,long)` indicating that the method does not check its parameters. Adding such checks would be an incompatible change.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 5041655: Further refinement of zero size lock specification
In the Unix version of `Java_sun_nio_ch_FileDispatcherImpl_lock0()`, I wonder whether in this block
if (size == (jlong)java_lang_Long_MAX_VALUE) {
fl.l_len = (off64_t)0;
} else {
fl.l_len = (off64_t)size;
}
the check should be changed to
if (pos + size == (jlong)java_lang_Long_MAX_VALUE) {
Similar question for `release0()`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7254
More information about the nio-dev
mailing list