From c3275b56a1470ed255441df6ff105d0c3c095d8b Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 30 Nov 2012 11:23:38 -0800 Subject: [PATCH] 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 Closes #1120 --- module/zfs/spa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);