-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix bp_embedded_type enum definition #8951
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8951 +/- ##
==========================================
+ Coverage 78.61% 78.7% +0.09%
==========================================
Files 388 388
Lines 120071 120071
==========================================
+ Hits 94388 94503 +115
+ Misses 25683 25568 -115
Continue to review full report at Codecov.
|
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.
How about fixing struct zdb_cb
in cmd/zdb/zdb.c
as well? E.g.:
typedef struct zdb_cb {
...
uint64_t zcb_embedded_blocks[NUM_BP_EMBEDDED_TYPES - 1];
uint64_t zcb_embedded_histogram[NUM_BP_EMBEDDED_TYPES - 1]
[BPE_PAYLOAD_SIZE + 1];
...
} zdb_cb_t;
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.
Currently, redaction BPs aren't actually used by redacted receive for performance reasons (need an efficient implementation of redacting large ranges); re-enabling them is on my roadmap.
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.
@loli10K thanks for catching this. @pcd1193182 helpfully referred me to the DxOS source where BP_EMBEDDED_TYPE_RESERVED
is defined and used for an entirely different feature. While you're here it would be a nice to update that comment. Maybe:
BP_EMBEDDED_TYPE_RESERVED, /* Reserved for Delphix byteswap feature. */
With the addition of BP_EMBEDDED_TYPE_REDACTED in 30af21b a couple of codepaths make wrong assumptions and could potentially result in errors. Signed-off-by: loli10K <[email protected]>
7fa9ca2
to
66caab6
Compare
With the addition of BP_EMBEDDED_TYPE_REDACTED in 30af21b a couple of codepaths make wrong assumptions and could potentially result in errors. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Chris Dunlop <[email protected]> Reviewed-by: Paul Dagnelie <[email protected]> Signed-off-by: loli10K <[email protected]> Closes openzfs#8951 Conflicts: include/sys/spa.h
With the addition of BP_EMBEDDED_TYPE_REDACTED in 30af21b a couple of codepaths make wrong assumptions and could potentially result in errors. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Chris Dunlop <[email protected]> Reviewed-by: Paul Dagnelie <[email protected]> Signed-off-by: loli10K <[email protected]> Closes openzfs#8951 Conflicts: include/sys/spa.h
With the addition of BP_EMBEDDED_TYPE_REDACTED in 30af21b a couple of codepaths make wrong assumptions and could potentially result in errors. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Chris Dunlop <[email protected]> Reviewed-by: Paul Dagnelie <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #8951 Conflicts: include/sys/spa.h
Motivation and Context
With the addition of BP_EMBEDDED_TYPE_REDACTED in 30af21b a couple of codepaths make wrong assumptions and could potentially result in errors.
With a bp (etype =
BP_EMBEDDED_TYPE_REDACTED
) we could panic inzfs_blkptr_verify()
:https://github.com/zfsonlinux/zfs/blob/30af21b02569ac192f52ce6e6511015f8a8d5729/module/zfs/zio.c#L910-L915
Also we would not be able to receive records with drr_etype =
BP_EMBEDDED_TYPE_REDACTED
:https://github.com/zfsonlinux/zfs/blob/30af21b02569ac192f52ce6e6511015f8a8d5729/module/zfs/dmu_recv.c#L1849-L1850
And finally we will fail an assetion in
dmu_write_embedded()
:https://github.com/zfsonlinux/zfs/blob/30af21b02569ac192f52ce6e6511015f8a8d5729/module/zfs/dmu.c#L1270-L1276
I'm not sure if
BP_EMBEDDED_TYPE_RESERVED
was supposed to beBP_EMBEDDED_TYPE_REDACTED
all along. I could not find any usage ofBP_SET_REDACTED()
,dmu_buf_redact()
anddmu_redact()
in the code.Description
Simply update
NUM_BP_EMBEDDED_TYPES
inbp_embedded_type_t
How Has This Been Tested?
Not tested, pushed as draft.
Types of changes
Checklist:
Signed-off-by
.