RFR: 8262844: FileStore.supportsFileAttributeView might return false negative in case of ext3

Arno Zeller azeller at openjdk.java.net
Wed Mar 3 11:10:39 UTC 2021


On Wed, 3 Mar 2021 02:14:17 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Based on testing it looks like xattr is enabled by default for ext2 and ext3 file systems in Ubuntu 18.04 LTS (Linux kernel 4.15.0).
>
> From [1]:
> 
>        Some filesystems, such as Reiserfs (and, historically, ext2 and
>        ext3), require the filesystem to be mounted with the user_xattr
>        mount option in order for user extended attributes to be used.
> 
>        In the current ext2, ext3, and ext4 filesystem implementations,
>        the total bytes used by the names and values of all of a file's
>        extended attributes must fit in a single filesystem block ....
> 
> which reads as if extended attributes are now always supported in ext2, ext3, and ext4.
> 
> [1] https://man7.org/linux/man-pages/man7/xattr.7.html

I can add that RHEL 8.3 also has extended attributes as default mount option for ext3 and will not show up in /proc/mounts.

To me it seems that the default was changed some time ago, but it might not be so easy to find a kernel version that enabled it by default as it was in case of ext4.

And even if we could find a kernel version that started to use it as default, it might still be possible to disable it during build time or by setting default mount options on the ext3 filesystem with tune2fs. These will also not show up in /proc/mounts (just checked on RHEL 8.3):

# tune2fs -l /dev/sdb1 | grep "Default mount"
Default mount options:    **user_xattr** acl
# cat /proc/mounts | grep /dev/sdb1


And this is the same for ext4.

I think the only save way to determine the support is to check on the filesystem. What do you think?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2778


More information about the nio-dev mailing list