Skip to content

Commit

Permalink
Minor zstream redup command fixes
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
behlendorf authored and as-com committed Jun 20, 2020
1 parent 183529b commit a703be2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions cmd/zstream/zstream_redup.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ zfs_redup_stream(int infd, int outfd, boolean_t verbose)
rdt.ddecache = umem_cache_create("rde", sizeof (redup_entry_t), 0,
NULL, NULL, NULL, NULL, NULL, 0);
rdt.numhashbits = highbit64(numbuckets) - 1;
rdt.ddt_count = 0;

char *buf = safe_calloc(bufsz);
FILE *ofp = fdopen(infd, "r");
Expand Down
1 change: 0 additions & 1 deletion cmd/zstreamdump/.gitignore

This file was deleted.

0 comments on commit a703be2

Please sign in to comment.