[9] RFR of 8073078: java/nio/file/FileStore/Basic.java sensitive to NFS configuration
Alan Bateman
Alan.Bateman at oracle.com
Thu Jul 2 06:28:21 UTC 2015
On 01/07/2015 23:07, Brian Burkhalter wrote:
> Please review at your convenience.
>
> Issue: https://bugs.openjdk.java.net/browse/JDK-8073078
> Patch: http://cr.openjdk.java.net/~bpb/8073078/webrev.00/
>
> This intermittent failure, which https://bugs.openjdk.java.net/browse/JDK-8081354 likely duplicates, appears to occur only on Unix platforms, and based on code inspection and an isolated test on OS X, seems to be due to the Java permissions of the FileStore being checked in the object returned by FileSystem.getFileStores() without the accessibility of the FileStore actually being checked. Consequently when spurious or inaccessible mount points appear a NoSuchFileException results. This change should omit the transient mount point from the iteration per the documentation of FileSystem.getFileStores():
>
> "When an I/O error occurs, perhaps because a file store is not accessible, then it is not returned by the iterator.”
>
> The usual core NIO regression tests passed on two test queues.
>
The changes in the webrev are confusing and are hiding the security
manager check. Another point is that this is the Unix provider
implementation so it should not be calling Paths.get. It won't work if
you have you interposed on the default provider for example.
I suspect that all you need here:
access(new UnixPath(this, entry.dir()), R_OK)
but important to check that it doesn't hang when NFS server is not
reachable.
-Alan.
More information about the nio-dev
mailing list