Add a "zstream decompress" subcommand

It can be used to repair a ZFS file system corrupted by ZFS bug #12762.
Use it like this:

zfs send -c <DS> | \
zstream decompress <OBJECT>,<OFFSET>[,<COMPRESSION_ALGO>] ... | \
zfs recv <DST_DS>

Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Signed-off-by: Alan Somers <asomers@gmail.com>
Sponsored-by:  Axcient
Workaround for #12762
Closes #13256
This commit is contained in:
Alan Somers
2022-06-24 14:28:42 -06:00
committed by GitHub
parent 1c0c729ab4
commit ccf89b39fe
7 changed files with 425 additions and 5 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ FILE *send_stream = 0;
boolean_t do_byteswap = B_FALSE;
boolean_t do_cksum = B_TRUE;
static void *
void *
safe_malloc(size_t size)
{
void *rv = malloc(size);