summaryrefslogtreecommitdiffstats
path: root/module/zfs/spa.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2012-11-30 11:23:38 -0800
committerBrian Behlendorf <[email protected]>2012-11-30 13:48:17 -0800
commitc3275b56a1470ed255441df6ff105d0c3c095d8b (patch)
treeb33ec47c0bce175d204a92355b74c1178841a93e /module/zfs/spa.c
parentc372b36e3eba18d1a8747b8375e3e7c049d40c89 (diff)
Add load_nvlist() error handling
Add the missing error handling to load_nvlist(). There's no good reason this needs to be fatal. All callers of load_nvlist() do correctly handle an error condition and it is preferable that an error be returned. This will allow 'zpool import -FX' to safely attempt to rollback through previous txgs looking for a good one. Signed-off-by: Brian Behlendorf <[email protected]> Closes #1120
Diffstat (limited to 'module/zfs/spa.c')
-rw-r--r--module/zfs/spa.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index 33798d3af..b610a0dae 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -1350,7 +1350,10 @@ load_nvlist(spa_t *spa, uint64_t obj, nvlist_t **value)
int error;
*value = NULL;
- VERIFY(0 == dmu_bonus_hold(spa->spa_meta_objset, obj, FTAG, &db));
+ error = dmu_bonus_hold(spa->spa_meta_objset, obj, FTAG, &db);
+ if (error)
+ return (error);
+
nvsize = *(uint64_t *)db->db_data;
dmu_buf_rele(db, FTAG);