diff options
author | Brian Behlendorf <[email protected]> | 2015-08-18 11:20:22 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-08-19 14:32:50 -0700 |
commit | ff9b1d07256c57b607cc6ad3448c1fb2487305d6 (patch) | |
tree | 26a43ff28da849d0867e2a64f2e2bbe001c0e85e | |
parent | 9f5ba90f9fb0aa39de35afaf6e9f385c4ddd8865 (diff) |
Handle zap_lookup() failure in ddt_object_load()
Failing to lookup a name in the spa_ddt_stat_object should not result
in a panic in ddt_object_load(). The error can be safely returned to
the caller for handling resulting in a useful user error message.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #3370
-rw-r--r-- | module/zfs/ddt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/module/zfs/ddt.c b/module/zfs/ddt.c index 18557ffb5..12c1b7300 100644 --- a/module/zfs/ddt.c +++ b/module/zfs/ddt.c @@ -115,13 +115,14 @@ ddt_object_load(ddt_t *ddt, enum ddt_type type, enum ddt_class class) error = zap_lookup(ddt->ddt_os, DMU_POOL_DIRECTORY_OBJECT, name, sizeof (uint64_t), 1, &ddt->ddt_object[type][class]); - if (error != 0) return (error); - VERIFY0(zap_lookup(ddt->ddt_os, ddt->ddt_spa->spa_ddt_stat_object, name, + error = zap_lookup(ddt->ddt_os, ddt->ddt_spa->spa_ddt_stat_object, name, sizeof (uint64_t), sizeof (ddt_histogram_t) / sizeof (uint64_t), - &ddt->ddt_histogram[type][class])); + &ddt->ddt_histogram[type][class]); + if (error != 0) + return (error); /* * Seed the cached statistics. |