RFR: 8232861: (fc) FileChannel.force fails on WebDAV file systems (macOS) [v2]

Brian Burkhalter bpb at openjdk.java.net
Wed Apr 7 16:54:49 UTC 2021


On Wed, 7 Apr 2021 16:46:12 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8232861: Fallback on F_FULLSYNC if file is remote instead of if errno is ENOTTY
>
> src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c line 184:
> 
>> 182:                 result = fsync(fd);
>> 183:             }
>> 184:         }
> 
> Do you need to save/restore errno so that the original error from fcntl(F_FULLSYNC) is used in the error handling?
> 
> Also what you would think about dropping the check for ENOTSUP.

I thought about `errno` but didn't know whether it's common practice to cache it like that.

We had `ENOTSUP` I suppose in case the `F_FULLSYNC` is unsupported on a local file system. From the man page of `fcntl()` the doc of `F_FULLSYNC` states
This is currently implemented on HFS, MS-DOS (FAT), Universal Disk Format (UDF) and APFS file systems
although `ENOTSUP` itself is not actually documented here.

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

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


More information about the nio-dev mailing list