*
* CDDL HEADER END
*/
+
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
*/
#include <sys/zfs_context.h>
}
if (dn->dn_next_bonustype[txgoff]) {
- ASSERT(dn->dn_next_bonustype[txgoff] < DMU_OT_NUMTYPES);
+ ASSERT(DMU_OT_IS_VALID(dn->dn_next_bonustype[txgoff]));
dnp->dn_bonustype = dn->dn_next_bonustype[txgoff];
dn->dn_next_bonustype[txgoff] = 0;
}
int i;
ASSERT(dn->dn_next_nblkptr[txgoff] < dnp->dn_nblkptr);
/* the blkptrs we are losing better be unallocated */
- for (i = dn->dn_next_nblkptr[txgoff];
- i < dnp->dn_nblkptr; i++)
- ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[i]));
+ for (i = 0; i < dnp->dn_nblkptr; i++) {
+ if (i >= dn->dn_next_nblkptr[txgoff])
+ ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[i]));
+ }
#endif
}
mutex_enter(&dn->dn_mtx);