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.c
          +++ new/usr/src/uts/common/fs/zfs/dmu.c
↓ open down ↓ 665 lines elided ↑ open up ↑
 666  666  dmu_free_long_range(objset_t *os, uint64_t object,
 667  667      uint64_t offset, uint64_t length)
 668  668  {
 669  669          dnode_t *dn;
 670  670          int err;
 671  671  
 672  672          err = dnode_hold(os, object, FTAG, &dn);
 673  673          if (err != 0)
 674  674                  return (err);
 675  675          err = dmu_free_long_range_impl(os, dn, offset, length);
      676 +
      677 +        /*
      678 +         * It is important to zero out the maxblkid when freeing the entire
      679 +         * file, so that (a) subsequent calls to dmu_free_long_range_impl()
      680 +         * will take the fast path, and (b) dnode_reallocate() can verify
      681 +         * that the entire file has been freed.
      682 +         */
      683 +        if (offset == 0 && length == DMU_OBJECT_END)
      684 +                dn->dn_maxblkid = 0;
      685 +
 676  686          dnode_rele(dn, FTAG);
 677  687          return (err);
 678  688  }
 679  689  
 680  690  int
 681  691  dmu_free_long_object(objset_t *os, uint64_t object)
 682  692  {
 683  693          dmu_tx_t *tx;
 684  694          int err;
 685  695  
↓ open down ↓ 1145 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX