Skip to content
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

Reorder ZFS ioctls to fix cross-version compatibility #8484

Merged
merged 2 commits into from
Mar 9, 2019

Conversation

lorenz
Copy link
Contributor

@lorenz lorenz commented Mar 7, 2019

Description

Fixes #8482

How Has This Been Tested?

If this is merged before 0.8 is released, it should have pretty much no impact on existing tooling (since there was never a released version of ZoL with the broken numbering) and avoids a lot of headaches when trying to support multiple releases.

I've tested the kernel side of this change, since it only changes constants and the original reordering didn't cause any issues I do not anticipate any on the userspace side either.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

Signed-off-by: Lorenz Brun <lorenz@dolansoft.org>
@behlendorf
Copy link
Contributor

@lorenz thanks for catching this! Yes, ZFS_IOC_CHANNEL_PROGRAM should have been added after ZFS_IOC_POOL_SYNC, I agree better to fix this now before it ends up in a tagged release.

You're going to need to update validate_ioc_values() in libzfs_input_check.c as part of this PR. This check was added to the test suite to specifically detect this kind of accidental reordering. (unfortunately it was added a little too late).

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Mar 7, 2019
@behlendorf behlendorf added this to the 0.8.0 milestone Mar 7, 2019
@lorenz lorenz force-pushed the fix-ioctl-reordering branch from 0e45388 to 62e683d Compare March 8, 2019 00:31
@lorenz
Copy link
Contributor Author

lorenz commented Mar 8, 2019

I've updated that now as well, but haven't locally tested it. I'll just let the CI run.

@behlendorf behlendorf requested a review from don-brady March 8, 2019 00:33
@behlendorf
Copy link
Contributor

Thanks. Might just be Github's rendering but it looks like there may be some cstyle white space issues.

@lorenz
Copy link
Contributor Author

lorenz commented Mar 8, 2019

I've actually just force-pushed a fix for that, but GitHub seems a bit slow to pick it up.

Signed-off-by: Lorenz Brun <lorenz@dolansoft.org>
@lorenz lorenz force-pushed the fix-ioctl-reordering branch from 62e683d to 0f0fb7d Compare March 8, 2019 00:42
@codecov
Copy link

codecov bot commented Mar 8, 2019

Codecov Report

Merging #8484 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8484      +/-   ##
==========================================
- Coverage   78.56%   78.54%   -0.03%     
==========================================
  Files         380      380              
  Lines      116047   116047              
==========================================
- Hits        91177    91144      -33     
- Misses      24870    24903      +33
Flag Coverage Δ
#kernel 79.02% <ø> (-0.02%) ⬇️
#user 66.98% <ø> (-0.08%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b46fd24...0f0fb7d. Read the comment docs.

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This will cause a little disruption for those using channel programs, zpool sync, and zfs recv on master if their user/kernel versions aren't in sync. But it will prevent these issues between the tagged 0.7 and 0.8 releases which is the most important thing.

@behlendorf behlendorf requested a review from ahrens March 8, 2019 17:10
@ahrens
Copy link
Member

ahrens commented Mar 8, 2019

Do we have any automated tests to ensure that these changes aren't made in the future?

@behlendorf
Copy link
Contributor

@ahrens we do. @don-brady added them, this is why it was necessary to update libzfs_input_check.c which contains to required order. Otherwise this PR would fail the test suite.

@ahrens
Copy link
Member

ahrens commented Mar 8, 2019

I see, so I guess that the change that introduced the problem happened before libzfs_input_check.c was added? Seems like we would normally want to not allow any changes to existing lines in that file, otherwise someone could reorder the ioctls, and then change the test to pass!

@behlendorf
Copy link
Contributor

@ahrens yes, that's exactly what happened. This issue predates adding the test case.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Mar 8, 2019
@behlendorf behlendorf merged commit bf90948 into openzfs:master Mar 9, 2019
@lorenz lorenz deleted the fix-ioctl-reordering branch March 9, 2019 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Channel Program reordered ioctls
5 participants