]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/zfs/dnode_sync.c
Fix typo/etc in module/zfs/zfs_ctldir.c
[mirror_zfs.git] / module / zfs / dnode_sync.c
index d1f28700d0ad2c91fa0c9a429a83c0caebb3d8c1..581f812a14d15e41c4c87e1ccbdb124cacd3e202 100644 (file)
@@ -31,7 +31,7 @@
 #include <sys/dmu.h>
 #include <sys/dmu_tx.h>
 #include <sys/dmu_objset.h>
-#include <sys/dmu_send.h>
+#include <sys/dmu_recv.h>
 #include <sys/dsl_dataset.h>
 #include <sys/spa.h>
 #include <sys/range_tree.h>
@@ -384,12 +384,7 @@ dnode_sync_free_range_impl(dnode_t *dn, uint64_t blkid, uint64_t nblks,
                }
        }
 
-       /*
-        * Do not truncate the maxblkid if we are performing a raw
-        * receive. The raw receive sets the mablkid manually and
-        * must not be overriden.
-        */
-       if (trunc && !dn->dn_objset->os_raw_receive) {
+       if (trunc) {
                ASSERTV(uint64_t off);
                dn->dn_phys->dn_maxblkid = blkid == 0 ? 0 : blkid - 1;
 
@@ -753,8 +748,8 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
        if (dn->dn_num_slots > DNODE_MIN_SLOTS) {
                dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset;
                mutex_enter(&ds->ds_lock);
-               ds->ds_feature_activation_needed[SPA_FEATURE_LARGE_DNODE] =
-                   B_TRUE;
+               ds->ds_feature_activation[SPA_FEATURE_LARGE_DNODE] =
+                   (void *)B_TRUE;
                mutex_exit(&ds->ds_lock);
        }
 
@@ -765,11 +760,13 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
 
        /*
         * This must be done after dnode_sync_free_range()
-        * and dnode_increase_indirection().
+        * and dnode_increase_indirection(). See dnode_new_blkid()
+        * for an explanation of the high bit being set.
         */
        if (dn->dn_next_maxblkid[txgoff]) {
                mutex_enter(&dn->dn_mtx);
-               dnp->dn_maxblkid = dn->dn_next_maxblkid[txgoff];
+               dnp->dn_maxblkid =
+                   dn->dn_next_maxblkid[txgoff] & ~DMU_NEXT_MAXBLKID_SET;
                dn->dn_next_maxblkid[txgoff] = 0;
                mutex_exit(&dn->dn_mtx);
        }