8009632: (fs) FileStore.supportsFileAttributeView does not detect user_xattr enabled on ext4

Brian Burkhalter brian.burkhalter at oracle.com
Thu Apr 12 00:15:26 UTC 2018


https://bugs.openjdk.java.net/browse/JDK-8009632

Remove special case handling of ext3 and ext4 and perform the check programmatically. xattr is enabled by default on at least ext4 and in any case there seems to be no point in having this special case.

Thanks,

Brian

— Patch —

--- a/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java
+++ b/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java
@@ -140,12 +140,7 @@
             if ((entry().hasOption("user_xattr")))
                 return true;
 
-            // user_xattr option not present but we special-case ext3/4 as we
-            // know that extended attributes are not enabled by default.
-            if (entry().fstype().equals("ext3") || entry().fstype().equals("ext4"))
-                return false;
-
-            // not ext3/4 so probe mount point
+            // probe mount point
             if (!xattrChecked) {
                 UnixPath dir = new UnixPath(file().getFileSystem(), entry().dir());
                 xattrEnabled = isExtendedAttributesEnabled(dir);



More information about the nio-dev mailing list