Skip to content

Commit

Permalink
Fix missing error check in restore_freeobjects
Browse files Browse the repository at this point in the history
  • Loading branch information
aither64 committed Apr 12, 2017
1 parent 0bbd80c commit 1b9552f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions module/zfs/dmu_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,13 +1600,14 @@ restore_freeobjects(struct restorearg *ra, objset_t *os,
struct drr_freeobjects *drrfo)
{
uint64_t obj;
int next_err = 0;

if (drrfo->drr_firstobj + drrfo->drr_numobjs < drrfo->drr_firstobj)
return (SET_ERROR(EINVAL));

for (obj = drrfo->drr_firstobj;
obj < drrfo->drr_firstobj + drrfo->drr_numobjs;
(void) dmu_object_next(os, &obj, FALSE, 0)) {
obj < drrfo->drr_firstobj + drrfo->drr_numobjs && next_err == 0;
next_err = dmu_object_next(os, &obj, FALSE, 0)) {
int err;

if (dmu_object_info(os, obj, NULL) != 0)
Expand All @@ -1616,6 +1617,8 @@ restore_freeobjects(struct restorearg *ra, objset_t *os,
if (err != 0)
return (err);
}
if (next_err != ESRCH)
return (next_err);
return (0);
}

Expand Down

0 comments on commit 1b9552f

Please sign in to comment.