Livelist logic should handle dedup blkptrs
authorSerapheim Dimitropoulos <serapheim@delphix.com>
Mon, 7 Jun 2021 19:09:07 +0000 (12:09 -0700)
committerGitHub <noreply@github.com>
Mon, 7 Jun 2021 19:09:07 +0000 (13:09 -0600)
commit86b5f4c121885001a472b2c5acf9cb25c81685c9
treeb59c5a59b5f33dce6d5bd57d0e1e42dfbdb95dd1
parentea400129c376c958e32bd912ea29905107ebe0bb
Livelist logic should handle dedup blkptrs

Update the logic to handle the dedup-case of consecutive
FREEs in the livelist code. The logic still ensures that
all the FREE entries are matched up with a respective
ALLOC by keeping a refcount for each FREE blkptr that we
encounter and ensuring that this refcount gets to zero
by the time we are done processing the livelist.

zdb -y no longer panics when encountering double frees

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Don Brady <don.brady@delphix.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #11480
Closes #12177
cmd/zdb/zdb.c
module/zfs/dsl_deadlist.c
tests/runfiles/common.run
tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_clone_livelist_dedup.ksh [new file with mode: 0755]