diff --git a/module/zfs/dmu_object.c b/module/zfs/dmu_object.c index 6fe4480d6d..d0e39a423b 100644 --- a/module/zfs/dmu_object.c +++ b/module/zfs/dmu_object.c @@ -409,6 +409,8 @@ dmu_object_next(objset_t *os, uint64_t *objectp, boolean_t hole, uint64_t txg) * hand off to dnode_next_offset() for further scanning. */ while (i <= last_obj) { + if (i == 0) + return (SET_ERROR(ESRCH)); error = dmu_object_info(os, i, &doi); if (error == ENOENT) { if (hole) {