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>

@@ -113,10 +113,11 @@
         dn->dn_newuid = 0;
         dn->dn_newgid = 0;
         dn->dn_id_flags = 0;
 
         dn->dn_dbufs_count = 0;
+        dn->dn_unlisted_l0_blkid = 0;
         list_create(&dn->dn_dbufs, sizeof (dmu_buf_impl_t),
             offsetof(dmu_buf_impl_t, db_link));
 
         dn->dn_moved = 0;
         return (0);

@@ -165,10 +166,11 @@
         ASSERT0(dn->dn_newuid);
         ASSERT0(dn->dn_newgid);
         ASSERT0(dn->dn_id_flags);
 
         ASSERT0(dn->dn_dbufs_count);
+        ASSERT0(dn->dn_unlisted_l0_blkid);
         list_destroy(&dn->dn_dbufs);
 }
 
 void
 dnode_init(void)

@@ -470,10 +472,11 @@
         dn->dn_olduid = 0;
         dn->dn_oldgid = 0;
         dn->dn_newuid = 0;
         dn->dn_newgid = 0;
         dn->dn_id_flags = 0;
+        dn->dn_unlisted_l0_blkid = 0;
 
         dmu_zfetch_rele(&dn->dn_zfetch);
         kmem_cache_free(dnode_cache, dn);
         arc_space_return(sizeof (dnode_t), ARC_SPACE_OTHER);
 }

@@ -700,10 +703,11 @@
         ASSERT(refcount_count(&odn->dn_tx_holds) == 0);
         refcount_transfer(&ndn->dn_holds, &odn->dn_holds);
         ASSERT(list_is_empty(&ndn->dn_dbufs));
         list_move_tail(&ndn->dn_dbufs, &odn->dn_dbufs);
         ndn->dn_dbufs_count = odn->dn_dbufs_count;
+        ndn->dn_unlisted_l0_blkid = odn->dn_unlisted_l0_blkid;
         ndn->dn_bonus = odn->dn_bonus;
         ndn->dn_have_spill = odn->dn_have_spill;
         ndn->dn_zio = odn->dn_zio;
         ndn->dn_oldused = odn->dn_oldused;
         ndn->dn_oldflags = odn->dn_oldflags;

@@ -734,10 +738,11 @@
         odn->dn_dbuf = NULL;
         odn->dn_handle = NULL;
         list_create(&odn->dn_dbufs, sizeof (dmu_buf_impl_t),
             offsetof(dmu_buf_impl_t, db_link));
         odn->dn_dbufs_count = 0;
+        odn->dn_unlisted_l0_blkid = 0;
         odn->dn_bonus = NULL;
         odn->dn_zfetch.zf_dnode = NULL;
 
         /*
          * Set the low bit of the objset pointer to ensure that dnode_move()

@@ -1521,11 +1526,11 @@
         rw_enter(&dn->dn_struct_rwlock, RW_WRITER);
         blksz = dn->dn_datablksz;
         blkshift = dn->dn_datablkshift;
         epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT;
 
-        if (len == -1ULL) {
+        if (len == DMU_OBJECT_END) {
                 len = UINT64_MAX - off;
                 trunc = TRUE;
         }
 
         /*