Print this page
3955 ztest failure: assertion refcount_count(&tx->tx_space_written) + delta <= tx->tx_space_towrite
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/dmu_tx.c
          +++ new/usr/src/uts/common/fs/zfs/dmu_tx.c
↓ open down ↓ 440 lines elided ↑ open up ↑
 441  441                          blkid = 0;
 442  442                          nblks = 1;
 443  443                  } else {
 444  444                          rw_exit(&dn->dn_struct_rwlock);
 445  445                          return;
 446  446                  }
 447  447          } else {
 448  448                  blkid = off >> dn->dn_datablkshift;
 449  449                  nblks = (len + dn->dn_datablksz - 1) >> dn->dn_datablkshift;
 450  450  
 451      -                if (blkid >= dn->dn_maxblkid) {
      451 +                if (blkid > dn->dn_maxblkid) {
 452  452                          rw_exit(&dn->dn_struct_rwlock);
 453  453                          return;
 454  454                  }
 455  455                  if (blkid + nblks > dn->dn_maxblkid)
 456      -                        nblks = dn->dn_maxblkid - blkid;
      456 +                        nblks = dn->dn_maxblkid - blkid + 1;
 457  457  
 458  458          }
 459  459          l0span = nblks;    /* save for later use to calc level > 1 overhead */
 460  460          if (dn->dn_nlevels == 1) {
 461  461                  int i;
 462  462                  for (i = 0; i < nblks; i++) {
 463  463                          blkptr_t *bp = dn->dn_phys->dn_blkptr;
 464  464                          ASSERT3U(blkid + i, <, dn->dn_nblkptr);
 465  465                          bp += blkid + i;
 466  466                          if (dsl_dataset_block_freeable(ds, bp, bp->blk_birth)) {
↓ open down ↓ 947 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX