diff options
author | delphij <delphij@FreeBSD.org> | 2013-01-10 19:26:56 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2013-01-10 19:26:56 +0000 |
commit | f8200d9bc4de2e18914c36bbeb76cffced6288c5 (patch) | |
tree | 415c6a7431ea475035a36a4e5afd7d7d20091f4b /cddl | |
parent | 09551b7a87c77dc36b39b368d4148b552c408ea0 (diff) | |
download | FreeBSD-src-f8200d9bc4de2e18914c36bbeb76cffced6288c5.zip FreeBSD-src-f8200d9bc4de2e18914c36bbeb76cffced6288c5.tar.gz |
The current ZFS code expects ddt_zap_count to always succeed by asserting
the underlying zap_count() to return no errors. However, it is possible
that the pool reaches to such a state where zap_count would return error,
leading to panics when a pool is imported.
This commit changes the ddt_zap_count to return error returned from
zap_count and handle the error appropriately. With this change, it's now
possible to let zpool rollback damaged transaction groups and import the
pool.
Obtained from: ZFS on Linux github (e8fd45a0f975c6b8ae8cd644714fc21f14fac2bf)
MFC after: 1 month
Diffstat (limited to 'cddl')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zdb/zdb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c index 362a405..82941af 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c @@ -704,7 +704,9 @@ dump_ddt(ddt_t *ddt, enum ddt_type type, enum ddt_class class) return; ASSERT(error == 0); - if ((count = ddt_object_count(ddt, type, class)) == 0) + error = ddt_object_count(ddt, type, class, &count); + ASSERT(error == 0); + if (count == 0) return; dspace = doi.doi_physical_blocks_512 << 9; |