-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8262844: (fs) FileStore.supportsFileAttributeView might return false negative in case of ext3 #2778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back azeller! A progress list of the required criteria for merging this PR into |
@ArnoZeller The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
@bplb Would you have cycles to look at this one? We've always tried to reduce the probing on the mount points but this one means we will probe ext3 systems. I can't quire tell if this is something specific to SuSE or whether other distributions enable it too. |
Apparently as of version 11-SP3, the default file system of SLES was changed to Ext3 [1]. In [2] it is stated that "The default inode size of ext3 file systems has been increased from 128 bytes to 256 bytes on SLES11, because of extended attributes / ACLs." From this it may be inferred that extended attributes are enabled by default from SLES 11. One may therefore suppose that the kernel was built with configuration item CONFIG_EXT3_FS_XATTR set to Y [3]. [1] https://www.suse.com/releasenotes/x86_64/SUSE-SLES/11-SP3/, section 6.8 |
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]:
which reads as if extended attributes are now always supported in ext2, ext3, and ext4. |
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):
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? |
I also think that if we were to do it right, we should go with always probing. @ArnoZeller, can you try that out in our test landscape? Alternatively, if there's a reason against always probing, maybe we could add an option to enable probing? |
Mailing list message from Alan Bateman on nio-dev: On 03/03/2021 11:10, Arno Zeller wrote:
Okay, it seems there is enough evidence now that extended attributes are -Alan. |
The latest changes remove the ext3/ext4 special handling and we should end up in probing. Let's see what the outcome of testing will be. If we were to do it like that, getKernelVersion() can be removed then as well. |
} | ||
|
||
// not ext3/4 so probe mount point | ||
// no other information available so probe mount point |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've removed the special handling for ext4 too, did you mean to do that? I think we'll need to do a lot of testing with this change as I suspect it going to bite back in some unusual configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the change was intentional. I thought that ext4 has the same issues as ext3 and it might be possible to change the mount options or default mount options for ext4 with tune2fs to contain nouser_xattr. In this case the JDK would not detect that extended attributes are not supported. But I must admit that I just falsified my theory. tune2fs does not allow nouser_xattr as mount option. So for ext4 it can only be that someone uses a kernel that was configured to not support extended attributes on ext4 - this might not occur in real life.
I will revert the change back to the original first change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the analysis. I think we've converged and we are in agreement that we are forced to remove the special handing of ext3.
@ArnoZeller This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 34 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@AlanBateman, @RealCLanger, @bplb) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@AlanBateman, @RealCLanger, @bplb : Thanks for the reviews! /integrate |
@ArnoZeller |
/sponsor |
@RealCLanger @ArnoZeller Since your change was applied there have been 34 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 8d3de4b. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
FileStore.supportsFileAttributeView might return a wrong value for ext3 mounts. In case of newer Linux distributions the extended attributes are enabled by default for ext3 mounts and do not show up /proc/mounts.
Currently the mount table is parsed to determine whether the mount options contain user_xattr or nouser_xattr. In case of neither entry it is expected that extended attributes are not supported on ext3.
This change removes the special handling for ext3 and ext4 and will always probe the fs if none of the options above are found. This should ensure that we return the right value.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/2778/head:pull/2778
$ git checkout pull/2778