Print this page
4047 panic from dbuf_free_range() from dmu_free_object() while doing zfs receive
Reviewed by: Adam Leventhal <ahl@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 ↓ 607 lines elided ↑ open up ↑
 608  608          /*
 609  609           * For i/o error checking, we read the first and last level-0
 610  610           * blocks if they are not aligned, and all the level-1 blocks.
 611  611           *
 612  612           * Note:  dbuf_free_range() assumes that we have not instantiated
 613  613           * any level-0 dbufs that will be completely freed.  Therefore we must
 614  614           * exercise care to not read or count the first and last blocks
 615  615           * if they are blocksize-aligned.
 616  616           */
 617  617          if (dn->dn_datablkshift == 0) {
 618      -                dmu_tx_count_write(txh, off, len);
      618 +                if (off != 0 || len < dn->dn_datablksz)
      619 +                        dmu_tx_count_write(txh, off, len);
 619  620          } else {
 620  621                  /* first block will be modified if it is not aligned */
 621  622                  if (!IS_P2ALIGNED(off, 1 << dn->dn_datablkshift))
 622  623                          dmu_tx_count_write(txh, off, 1);
 623  624                  /* last block will be modified if it is not aligned */
 624  625                  if (!IS_P2ALIGNED(off + len, 1 << dn->dn_datablkshift))
 625  626                          dmu_tx_count_write(txh, off+len, 1);
 626  627          }
 627  628  
 628  629          /*
↓ open down ↓ 785 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX