8224617: (fs) java/nio/file/FileStore/Basic.java found filesystem twice

Brian Burkhalter brian.burkhalter at oracle.com
Fri May 24 23:39:30 UTC 2019


https://bugs.openjdk.java.net/browse/JDK-8224617
http://cr.openjdk.java.net/~bpb/8224617/webrev.00/

The proposed change adds a method “checkMountPoints()” to the FileUtils test library class and in FileStore/Basic.java replaces the use of FileUtils.areFileSystemsAccessible() with the new method. The new method accomplishes the same thing as areFileSystemsAccessible() but additionally checks that there are not duplicate mount points on the system. This latter would indicate a file system misconfiguration which would formerly have appeared as a FileStore failure but with the present change is flagged explicitly as a system configuration problem.

One question about the new code is whether the test at lines 269-279 of the new version of FileUtils should not assume that duplicates occur in succession in the output of ‘df.’ (This is assumed in Basic in the testing for dulicate FileStores). An alternative would be to accumulate each new non-null entry into a Set and check whether adding the entry actually changed the Set. If it did not then there is a duplicate.

Thanks,

Brian


More information about the nio-dev mailing list