X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fdnode_sync.c;h=58fa473cb314d0380a0c6b5b7a12f535f7478fe8;hb=89103a264343b0fed763a4ed0cc331b7233bef0d;hp=7d304b2f7ba359e8f079fbdf4c48da44cb571003;hpb=1fde1e37208c2f56c72c70a06676676f04b65998;p=zfs.git diff --git a/module/zfs/dnode_sync.c b/module/zfs/dnode_sync.c index 7d304b2..58fa473 100644 --- a/module/zfs/dnode_sync.c +++ b/module/zfs/dnode_sync.c @@ -18,8 +18,10 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -418,9 +420,13 @@ dnode_evict_dbufs(dnode_t *dn) if (evicting) delay(1); pass++; - ASSERT(pass < 100); /* sanity check */ + if ((pass % 100) == 0) + dprintf("Exceeded %d passes evicting dbufs\n", pass); } while (progress); + if (pass >= 100) + dprintf("Required %d passes to evict dbufs\n", pass); + rw_enter(&dn->dn_struct_rwlock, RW_WRITER); if (dn->dn_bonus && refcount_is_zero(&dn->dn_bonus->db_holds)) { mutex_enter(&dn->dn_bonus->db_mtx); @@ -594,7 +600,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) } 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; } @@ -662,9 +668,10 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) 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);