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

Minor zstream redup command fixes #10192

Merged
merged 1 commit into from
Apr 11, 2020

Conversation

behlendorf
Copy link
Contributor

@behlendorf behlendorf commented Apr 10, 2020

Motivation and Context

Resolve build warning introduced by #10156.

Description

  • Fix uninitialized variable in zstream redup command. The
    'rdt.ddt_count' variable is uninitialized because it was
    allocated from the stack and not globally. Initialize it.
    This was reported by gcc when compiling with debugging enabled.

    zstream_redup.c:157:16: error: 'rdt.ddt_count' may be used
    uninitialized in this function [-Werror=maybe-uninitialized]

  • Remove the cmd/zstreamdump/.gitignore file. It's no longer
    needed now that the zstreamdump command is a script.

How Has This Been Tested?

Locally compiled with the fix applied to verify the warning was resolved.

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:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes.
  • I have run the ZFS Test Suite with this change applied.
  • All commit messages are properly formatted and contain Signed-off-by.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Apr 10, 2020
@behlendorf behlendorf requested a review from ahrens April 10, 2020 23:24
Copy link
Member

@ahrens ahrens left a comment

Choose a reason for hiding this comment

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

Good catch, thanks!

* Fix uninitialized variable in `zstream redup` command.  The
  'rdt.ddt_count' variable is uninitialized because it was
  allocated from the stack and not globally.  Initialize it.
  This was reported by gcc when compiling with debugging enabled.

    zstream_redup.c:157:16: error: 'rdt.ddt_count' may be used
    uninitialized in this function [-Werror=maybe-uninitialized]

* Remove the cmd/zstreamdump/.gitignore file.  It's no longer
  needed now that the zstreamdump command is a script.

Signed-off-by: Brian Behlendorf <[email protected]>
@behlendorf behlendorf force-pushed the issue-10156-followup branch from d6ec70e to 8e31b23 Compare April 10, 2020 23:36
@behlendorf behlendorf changed the title Fix uninitialized variable in zstream redup command Minor zstream redup command fixes Apr 10, 2020
@behlendorf
Copy link
Contributor Author

@ahrens would you mind taking another look. I added a second small fix for an issue @bwatkinson discovered.

@behlendorf behlendorf requested a review from ahrens April 10, 2020 23:41
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Apr 11, 2020
@behlendorf behlendorf merged commit 8080848 into openzfs:master Apr 11, 2020
as-com pushed a commit to as-com/zfs that referenced this pull request Jun 20, 2020
* Fix uninitialized variable in `zstream redup` command.  The
  'rdt.ddt_count' variable is uninitialized because it was
  allocated from the stack and not globally.  Initialize it.
  This was reported by gcc when compiling with debugging enabled.

    zstream_redup.c:157:16: error: 'rdt.ddt_count' may be used
    uninitialized in this function [-Werror=maybe-uninitialized]

* Remove the cmd/zstreamdump/.gitignore file.  It's no longer
  needed now that the zstreamdump command is a script.

Reviewed-by: Matthew Ahrens <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#10192 
(cherry picked from commit 8080848)
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
* Fix uninitialized variable in `zstream redup` command.  The
  'rdt.ddt_count' variable is uninitialized because it was
  allocated from the stack and not globally.  Initialize it.
  This was reported by gcc when compiling with debugging enabled.

    zstream_redup.c:157:16: error: 'rdt.ddt_count' may be used
    uninitialized in this function [-Werror=maybe-uninitialized]

* Remove the cmd/zstreamdump/.gitignore file.  It's no longer
  needed now that the zstreamdump command is a script.

Reviewed-by: Matthew Ahrens <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#10192
@behlendorf behlendorf deleted the issue-10156-followup branch April 19, 2021 19:23
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.

2 participants