Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8262844

(fs) FileStore.supportsFileAttributeView might return false negative in case of ext3

XMLWordPrintable

    • b13
    • linux

        On several of our Suse Linux Enterprise Server 12 and 15 machines I can see that FileStore.supportsFileAttributeView on an ext3 mount returns false but in reality the FS supports extended file attributes and it is possible to write them from Java.
        I attached a short program to check this. Here is an example output:

        ># bin/java TestUDFAV /priv/
        FileSystemProvider: sun.nio.fs.LinuxFileSystemProvider@764c12b6
        FileStore.supportsFileAttributeView says: false
        UserDefinedFileAttributeView: sun.nio.fs.LinuxUserDefinedFileAttributeView@33909752
        UserDefinedFileAttributeView.list() returned []
        UserDefinedFileAttributeView.write("user.test", ...)
        UserDefinedFileAttributeView.list() returned [user.test]


        ># cat /proc/mounts
        ...
        /dev/mapper/vg_a-lv_prod /prod ext3 rw,relatime,data=ordered 0 0
        ...


        The behavior was already adjusted to some corner cases several times. I am not sure why there is a special handling for ext3/4 to not call the real check isExtendedAttributesEnabled(dir) for these two file systems. I guess it is for performance reasons, but on the other hand this might not be called with high frequency and it seems to be cached.

        I would suggest to skip the special handling for ext3 in LinuxFileStore.java and probe to be sure what is really enabled.

              azeller Arno Zeller
              azeller Arno Zeller
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: