Skip to content

Commit

Permalink
Add load_nvlist() error handling
Browse files Browse the repository at this point in the history
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
  • Loading branch information
behlendorf committed Nov 30, 2012
1 parent c372b36 commit c3275b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion module/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c3275b5

Please sign in to comment.