]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Minor `zstream redup` command fixes
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 11 Apr 2020 04:10:09 +0000 (21:10 -0700)
committerGitHub <noreply@github.com>
Sat, 11 Apr 2020 04:10:09 +0000 (21:10 -0700)
* 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 <mahrens@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #10192

cmd/zstream/zstream_redup.c
cmd/zstreamdump/.gitignore [deleted file]

index 6720cfd1201cf6025d51468d9c6b8fd264e204a9..9ed8df337f01cbc6ffe6421b013f29af0520be88 100644 (file)
@@ -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");
diff --git a/cmd/zstreamdump/.gitignore b/cmd/zstreamdump/.gitignore
deleted file mode 100644 (file)
index ca44a52..0000000
+++ /dev/null
@@ -1 +0,0 @@
-zstreamdump