Print this page
4082 zfs receive gets EFBIG from dmu_tx_hold_free()
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@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 ↓ 597 lines elided ↑ open up ↑
 598  598          if (txh == NULL)
 599  599                  return;
 600  600          dn = txh->txh_dnode;
 601  601          dmu_tx_count_dnode(txh);
 602  602  
 603  603          if (off >= (dn->dn_maxblkid+1) * dn->dn_datablksz)
 604  604                  return;
 605  605          if (len == DMU_OBJECT_END)
 606  606                  len = (dn->dn_maxblkid+1) * dn->dn_datablksz - off;
 607  607  
 608      -
 609  608          /*
 610  609           * For i/o error checking, we read the first and last level-0
 611  610           * blocks if they are not aligned, and all the level-1 blocks.
 612  611           *
 613  612           * Note:  dbuf_free_range() assumes that we have not instantiated
 614  613           * any level-0 dbufs that will be completely freed.  Therefore we must
 615  614           * exercise care to not read or count the first and last blocks
 616  615           * if they are blocksize-aligned.
 617  616           */
 618  617          if (dn->dn_datablkshift == 0) {
 619  618                  if (off != 0 || len < dn->dn_datablksz)
 620      -                        dmu_tx_count_write(txh, off, len);
      619 +                        dmu_tx_count_write(txh, 0, dn->dn_datablksz);
 621  620          } else {
 622  621                  /* first block will be modified if it is not aligned */
 623  622                  if (!IS_P2ALIGNED(off, 1 << dn->dn_datablkshift))
 624  623                          dmu_tx_count_write(txh, off, 1);
 625  624                  /* last block will be modified if it is not aligned */
 626  625                  if (!IS_P2ALIGNED(off + len, 1 << dn->dn_datablkshift))
 627  626                          dmu_tx_count_write(txh, off+len, 1);
 628  627          }
 629  628  
 630  629          /*
↓ open down ↓ 979 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX