Skip to content

[2.1.10] Add missing increment to dsl_deadlist_move_bpobj() #14587

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

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

behlendorf
Copy link
Contributor

Motivation and Context

Backport of followup fix for dc5c800 recently merged to staging.

Description

dc5c800 was recently merged to prefetch up to 128 deadlists. Unfortunately, a loop was missing an increment, such that it will prefetch all deadlists. The performance properties of that patch probably should be re-evaluated.

This was caught by CodeQL's cpp/constant-comparison check in an experimental branch where I am testing the security-and-extended queries. It complained about the i < 128 part of the loop condition always evaluating to the same thing. The standard CodeQL configuration we use missed this because it does not include that check.

How Has This Been Tested?

CI run against the master branch. See #14573.

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)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

dc5c800 was recently merged to prefetch
up to 128 deadlists. Unfortunately, a loop was missing an increment,
such that it will prefetch all deadlists. The performance properties of
that patch probably should be re-evaluated.

This was caught by CodeQL's cpp/constant-comparison check in an
experimental branch where I am testing the security-and-extended
queries. It complained about the `i < 128` part of the loop condition
always evaluating to the same thing. The standard CodeQL configuration
we use missed this because it does not include that check.

Reviewed-by: Tino Reichardt <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #14573
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Mar 7, 2023
@behlendorf behlendorf requested a review from amotin March 7, 2023 00:19
@behlendorf behlendorf changed the title Add missing increment to dsl_deadlist_move_bpobj() [2.1.10] Add missing increment to dsl_deadlist_move_bpobj() Mar 7, 2023
Copy link
Contributor

@ryao ryao left a comment

Choose a reason for hiding this comment

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

@behlendorf I heard from @amotin on the weekend that he wanted this to be backported after it went into master, so there is no need to wait for his okay on backporting this.

@behlendorf behlendorf merged commit 6281b5c into zfs-2.1.10-staging Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Code Review Needed Ready for review and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants