zio_decompress_data always ASSERTs successful decompression

This interferes with zdb_read_block trying all the decompression
algorithms when the 'd' flag is specified, as some are
expected to fail.  Also control the output when guessing
algorithms, try the more common compression types first, allow
specifying lsize/psize, and fix an uninitialized variable.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
Closes #9612 
Closes #9630
This commit is contained in:
Paul Zuchowski
2019-12-10 18:51:58 -05:00
committed by Brian Behlendorf
parent b119e2c6f1
commit f0bf435176
6 changed files with 205 additions and 59 deletions
+6 -4
View File
@@ -63,7 +63,7 @@
.Op Fl A
.Op Fl e Oo Fl V Oc Op Fl p Ar path ...
.Op Fl U Ar cache
.Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar size Ns Op : Ns Ar flags
.Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar [<lsize>/]<psize> Ns Op : Ns Ar flags
.Nm
.Fl S
.Op Fl AP
@@ -228,7 +228,7 @@ This option can be combined with
.Fl v
for increasing verbosity.
.It Xo
.Fl R Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar size Ns Op : Ns Ar flags
.Fl R Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar [<lsize>/]<psize> Ns Op : Ns Ar flags
.Xc
Read and display a block from the specified device.
By default the block is displayed as a hex dump, but see the description of the
@@ -241,8 +241,8 @@ The block is specified in terms of a colon-separated tuple
.Ar offset
.Pq the offset within the vdev
.Ar size
.Pq the size of the block to read
and, optionally,
.Pq the physical size, or logical size / physical size
of the block to read and, optionally,
.Ar flags
.Pq a set of flags, described below .
.Pp
@@ -263,6 +263,8 @@ Dump gang block header
Dump indirect block
.It Sy r
Dump raw uninterpreted block data
.It Sy v
Verbose output for guessing compression algorithm
.El
.It Fl s
Report statistics on