-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Allow inherited properties in zfs_check_settable() #7757
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 #7757 +/- ##
==========================================
+ Coverage 78.46% 78.46% +<.01%
==========================================
Files 368 368
Lines 112301 112142 -159
==========================================
- Hits 88114 87995 -119
+ Misses 24187 24147 -40
Continue to review full report at Codecov.
|
tcaputi
left a comment
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.
This patch looks good and definitely seems to solve the problem you found. I think we may have some further work to do here, in that I don't see any place where nvpair type validation is done. zfs_check_settable() seems to assume (for all properties it looks at) that it will be the correct type and if not it defaults to allow it, which seems non-ideal. I am also aware of some things you can do with zfs set that will allow you to avoid some value checks.
|
@loli10K Yes, that is what I was remembering. I'm not sure how relevant it is to this PR, but I thought I'd mention it. |
module/zfs/zfs_ioctl.c
Outdated
| return (SET_ERROR(ENOTSUP)); | ||
|
|
||
| if (nvpair_type(pair) == DATA_TYPE_BOOLEAN) | ||
| break; |
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.
nit: could we instead structure this in the same way as the other case blocks. The explicit check for DATA_TYPE_BOOLEAN I find a little non-intuitive.
if (nvpair_type(pair) == DATA_TYPE_UINT64 &&
nvpair_value_uint64(pair, &intval) == 0) {
...
}This change modifies how 'checksum' and 'dedup' properties are verified in zfs_check_settable() handling the case where they are explicitly inherited in the dataset hierarchy when receiving a recursive send stream. Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
|
Any chance this could get backported for an 0.7.X point release, so we don't have to wait until 0.8.0 to do -x checksum? :) |
|
@behlendorf is this low-risk enough to include in 0.7.10? I'm putting together the patchset right now. |
|
@tonyhutter yes. |
|
@behlendorf ok I'll include it. |
This change modifies how 'checksum' and 'dedup' properties are verified in zfs_check_settable() handling the case where they are explicitly inherited in the dataset hierarchy when receiving a recursive send stream. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#7755 Closes openzfs#7576 Closes openzfs#7757
This change modifies how 'checksum' and 'dedup' properties are verified in zfs_check_settable() handling the case where they are explicitly inherited in the dataset hierarchy when receiving a recursive send stream. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#7755 Closes openzfs#7576 Closes openzfs#7757 Requires-spl: refs/pull/707/head
This change modifies how 'checksum' and 'dedup' properties are verified in zfs_check_settable() handling the case where they are explicitly inherited in the dataset hierarchy when receiving a recursive send stream. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#7755 Closes openzfs#7576 Closes openzfs#7757 Requires-spl: refs/pull/707/head
This change modifies how 'checksum' and 'dedup' properties are verified in zfs_check_settable() handling the case where they are explicitly inherited in the dataset hierarchy when receiving a recursive send stream. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#7755 Closes openzfs#7576 Closes openzfs#7757 Requires-spl: refs/pull/707/head
This change modifies how 'checksum' and 'dedup' properties are verified in zfs_check_settable() handling the case where they are explicitly inherited in the dataset hierarchy when receiving a recursive send stream. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#7755 Closes openzfs#7576 Closes openzfs#7757
This change modifies how 'checksum' and 'dedup' properties are verified in zfs_check_settable() handling the case where they are explicitly inherited in the dataset hierarchy when receiving a recursive send stream. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#7755 Closes openzfs#7576 Closes openzfs#7757
Motivation and Context
Some properties ("checksum", "dedup") cause issues when received with
zfs recv -o:Fix #7755
Fix #7576
Description
This change modifies how 'checksum' and 'dedup' properties are verified in
zfs_check_settable()handling the case where they are explicitly inherited (nvpair type = DATA_TYPE_BOOLEAN) in the dataset hierarchy when receiving a recursive send stream.How Has This Been Tested?
Used systemtap to find where the error is coming from, tested fix on local development Debian8 running the updated
functional/cli_root/zfs_receive/receive-o-x_props_overridetest case.Slightly off topic question, does anyone know how to inspect nvlist/nvpair data structures from systemtap/dtrace?
Types of changes
Checklist:
Signed-off-by.