aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2016-08-10 16:28:58 -0700
committerBrian Behlendorf <[email protected]>2016-08-11 15:21:32 -0700
commitb320dd91a9262633200c9570442659989a677f0c (patch)
tree5ac3b56bd7d0f1c52bf58cf3256fffa2fe9bd9d0
parentd9c97ec08b995f1a36657accc4bbc6057645a72c (diff)
Fix infinite loop when zdb -R with d flag
Also print decompress progress to stderr so it wouldn't pollute raw output with r flag. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4956
-rw-r--r--cmd/zdb/zdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index b6ce9deb0..5a196c452 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -3500,7 +3500,8 @@ zdb_read_block(char *thing, spa_t *spa)
for (lsize = psize + SPA_MINBLOCKSIZE;
lsize <= SPA_MAXBLOCKSIZE; lsize += SPA_MINBLOCKSIZE) {
for (c = 0; c < ZIO_COMPRESS_FUNCTIONS; c++) {
- (void) printf("Trying %05llx -> %05llx (%s)\n",
+ (void) fprintf(stderr,
+ "Trying %05llx -> %05llx (%s)\n",
(u_longlong_t)psize, (u_longlong_t)lsize,
zio_compress_table[c].ci_name);
if (zio_decompress_data(c, pbuf, lbuf,
@@ -3512,7 +3513,6 @@ zdb_read_block(char *thing, spa_t *spa)
}
if (c != ZIO_COMPRESS_FUNCTIONS)
break;
- lsize -= SPA_MINBLOCKSIZE;
}
umem_free(pbuf2, SPA_MAXBLOCKSIZE);