-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ZTS: Update O_TMPFILE support check #7528
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
Codecov Report
@@ Coverage Diff @@
## master #7528 +/- ##
==========================================
+ Coverage 77.43% 77.46% +0.02%
==========================================
Files 336 336
Lines 107521 107524 +3
==========================================
+ Hits 83263 83295 +32
+ Misses 24258 24229 -29
Continue to review full report at Codecov.
|
| * support O_TMPFILE. | ||
| */ | ||
| if (errno == EISDIR) { | ||
| if (errno == ENOENT || errno == EOPNOTSUPP) { |
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.
http://man7.org/linux/man-pages/man2/open.2.html
One must check for two different error codes, EISDIR and ENOENT, when trying to determine whether the kernel supports O_TMPFILE functionality.
I don't know why I didn't check for both EISDIR and ENOENT, but we shouldn't check for EOPNOTSUPP because that flag means kernel supports it, but filesystem doesn't. And as long as kernel supports, we should not skip the test.
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.
Interesting, I should have dug a little deeper before assuming the new CentOS 7.5 kernel didn't support it. Apparently it does, in a non-standard way, to preserve the existing KABI. We could probably update ZFS to use the extended interface with a little work. But it would probably be better for compatibility to add a way to make it clear we know that the kernel interface is available but we've intentionally decided to not use it.
@tuxoko would you mind taking over this issue and sorting it out? I'll just close this PR.
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.
@behlendorf
Can you point out where I can find about what CentOS does differently than others?
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 can download the full kernel source here.
| DISK=${DISKS%% *} | ||
| default_setup_noexit $DISK | ||
|
|
||
| if ! $STF_SUITE/tests/functional/tmpfile/tmpfile_test $TESTDIR/tmpfile; then |
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.
Is $TESTDIR/tmpfile a file or directory?
O_TMPFILE should take a directory as pathname argument.
In CentOS 7.5 the kernel provided a compatibility wrapper to support O_TMPFILE. This results in the test setup script correctly detecting kernel support. But the ZFS module was built without O_TMPFILE support due to the non-standard CentOS kernel interface. Handle this case by updating the setup check to fail either when the kernel or the ZFS module fail to provide support. The reason will be clearly logged in the test results. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
@tuxoko I've refreshed this PR so the tests are skipped if either the kernel or ZFS filesystem lack I looked in to updating the kernel code to use the new |
|
@behlendorf |
In CentOS 7.5 the kernel provided a compatibility wrapper to support O_TMPFILE. This results in the test setup script correctly detecting kernel support. But the ZFS module was built without O_TMPFILE support due to the non-standard CentOS kernel interface. Handle this case by updating the setup check to fail either when the kernel or the ZFS module fail to provide support. The reason will be clearly logged in the test results. Reviewed-by: Chunwei Chen <tuxoko@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#7528
In CentOS 7.5 the kernel provided a compatibility wrapper to support O_TMPFILE. This results in the test setup script correctly detecting kernel support. But the ZFS module was built without O_TMPFILE support due to the non-standard CentOS kernel interface. Handle this case by updating the setup check to fail either when the kernel or the ZFS module fail to provide support. The reason will be clearly logged in the test results. Reviewed-by: Chunwei Chen <tuxoko@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #7528
Description
In CentOS 7.5 the kernel provided a compatibility wrapper to support O_TMPFILE. This results in the test setup script correctly detecting kernel support. But the ZFS module was built without O_TMPFILE support due to the non-standard CentOS kernel interface.
Handle this case by updating the setup check to fail either when the kernel or the ZFS module fail to provide support. The reason will be clearly logged in the test results.
Motivation and Context
Fix test failures with CentOS 7.5.
How Has This Been Tested?
Locally on CentOS 7.5. Pending results from bots on other distributions.
Types of changes
Checklist:
Signed-off-by.