Author: avg
Date: Tue Oct 15 14:20:11 2019
New Revision: 353556
URL: https://svnweb.freebsd.org/changeset/base/353556

Log:
  MFV r353551: 10452 ZoL: merge in large dnode feature fixes
  
  illumos/illumos-gate@946342a260bbae359b48bf142ec1fe40792ee862
  
https://github.com/illumos/illumos-gate/commit/946342a260bbae359b48bf142ec1fe40792ee862
  
  https://www.illumos.org/issues/10452
    illumos is missing a few small follow up ZoL bug fixes for the large dnode
    feature. We should pull those in.
    Those commits are in the ZoL tree as (newest to oldest):
    PR 8435 - 75d6b7ddca269542279975f716a343bb40a79baf - Add missing copyright
    notice to large_dnode tests
    PR 7433 - e14a32b1c844d924b9f093375c0badcf10f61741 - Fix object reclaim when
    using large dnodes
    PR 6616 - 48fbb9ddbf2281911560dfbc2821aa8b74127315 - Free objects when
    receiving full stream as clone
    PR 6695 - 39f56627ae988d09b4e3803c01c22b2026b2310e - receive_freeobjects()
    skips freeing some object
  
  Portions contributed by: Ned Bass <ba...@llnl.gov>
  Portions contributed by: Tom Caputi <tcap...@datto.com>
  Author: Fabian Grünbichler <f.gruenbich...@proxmox.com>
  Obtained from:        illumos, ZoL
  MFC after:    2 weeks
  X-MFC with:   r353176

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c    Tue Oct 
15 14:19:44 2019        (r353555)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c    Tue Oct 
15 14:20:11 2019        (r353556)
@@ -267,7 +267,7 @@ dmu_object_reclaim(objset_t *os, uint64_t object, dmu_
     int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx)
 {
        return (dmu_object_reclaim_dnsize(os, object, ot, blocksize, bonustype,
-           bonuslen, 0, tx));
+           bonuslen, DNODE_MIN_SIZE, tx));
 }
 
 int

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c      Tue Oct 
15 14:19:44 2019        (r353555)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c      Tue Oct 
15 14:20:11 2019        (r353556)
@@ -2268,11 +2268,13 @@ receive_object(struct receive_writer_arg *rwa, struct 
        } else if (drro->drr_type != doi.doi_type ||
            drro->drr_blksz != doi.doi_data_block_size ||
            drro->drr_bonustype != doi.doi_bonus_type ||
-           drro->drr_bonuslen != doi.doi_bonus_size) {
+           drro->drr_bonuslen != doi.doi_bonus_size ||
+           drro->drr_dn_slots != (doi.doi_dnodesize >> DNODE_SHIFT)) {
                /* currently allocated, but with different properties */
-               err = dmu_object_reclaim(rwa->os, drro->drr_object,
+               err = dmu_object_reclaim_dnsize(rwa->os, drro->drr_object,
                    drro->drr_type, drro->drr_blksz,
-                   drro->drr_bonustype, drro->drr_bonuslen, tx);
+                   drro->drr_bonustype, drro->drr_bonuslen,
+                   drro->drr_dn_slots << DNODE_SHIFT, tx);
        }
        if (err != 0) {
                dmu_tx_commit(tx);
@@ -2323,12 +2325,10 @@ receive_freeobjects(struct receive_writer_arg *rwa,
                int err;
 
                err = dmu_object_info(rwa->os, obj, NULL);
-               if (err == ENOENT) {
-                       obj++;
+               if (err == ENOENT)
                        continue;
-               } else if (err != 0) {
+               else if (err != 0)
                        return (err);
-               }
 
                err = dmu_free_long_object(rwa->os, obj);
                if (err != 0)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Oct 15 
14:19:44 2019        (r353555)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Oct 15 
14:20:11 2019        (r353556)
@@ -680,8 +680,7 @@ dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, in
        ASSERT(DMU_OT_IS_VALID(bonustype));
        ASSERT3U(bonuslen, <=,
            DN_BONUS_SIZE(spa_maxdnodesize(dmu_objset_spa(dn->dn_objset))));
-
-       dn_slots = dn_slots > 0 ? dn_slots : DNODE_MIN_SLOTS;
+       ASSERT3U(bonuslen, <=, DN_BONUS_SIZE(dn_slots << DNODE_SHIFT));
 
        dnode_free_interior_slots(dn);
        DNODE_STAT_BUMP(dnode_reallocate);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to