8230085: (fs) FileStore::isReadOnly is always true on macOS Catalina

Brian Burkhalter brian.burkhalter at oracle.com
Fri Sep 13 14:42:31 UTC 2019


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

In macOS Catalina the system volume is replaced with a volume group consisting of a read-only system volume and a read-write data volume. The latter is at /Systems/Volumes/Data. A number of “firmlinks” (cf. /usr/share/firmlinks) define bi-directional traversal points between the read-only and read-write volumes. Examples of these are /Users and /private (which includes /private/tmp). This change caused a failure due to the algorithm used to attempt to identify the FileStore containing a given path. This algorithm using the device ID (stat.st_dev) which turns out to be the same for the system and data volumes and is therefore unreliable to this purpose.

This patch proposes to use statfs.f_mntonname to identify the volume containing a given path in step 2 of sub.nio.fs.BsdFileStore.findMountEntry(). A new method is added to retrieve f_mntonname. This could have been made an attribute but this would be redundant with the FilStore and would add attribute baggage to the file.

One question is whether f_mntonname should also be used in creating the list of FileStores.

Thanks,

Brian


More information about the nio-dev mailing list