The branch main has been updated by markj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=46402fd21631b7d4686f8c341d92db6bcb190e5d

commit 46402fd21631b7d4686f8c341d92db6bcb190e5d
Author:     Mark Johnston <ma...@freebsd.org>
AuthorDate: 2023-09-27 15:56:33 +0000
Commit:     Mark Johnston <ma...@freebsd.org>
CommitDate: 2023-09-27 16:00:00 +0000

    makefs/zfs: Set the objset block pointer fill field correctly
    
    It is supposed to contain the number of objects allocated from the set,
    excluding the meta dnode.
    
    Reported by:    mav
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
---
 usr.sbin/makefs/zfs/objset.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/makefs/zfs/objset.c b/usr.sbin/makefs/zfs/objset.c
index 22277c150712..3e3dcdeced4b 100644
--- a/usr.sbin/makefs/zfs/objset.c
+++ b/usr.sbin/makefs/zfs/objset.c
@@ -121,6 +121,7 @@ _objset_write(zfs_opt_t *zfs, zfs_objset_t *os, struct 
dnode_cursor *c,
        STAILQ_FOREACH_SAFE(chunk, &os->dnodechunks, next, tmp) {
                unsigned int i;
 
+               assert(chunk->nextfree > 0);
                assert(chunk->nextfree <= os->dnodecount);
                assert(chunk->nextfree <= DNODES_PER_CHUNK);
 
@@ -149,8 +150,8 @@ _objset_write(zfs_opt_t *zfs, zfs_objset_t *os, struct 
dnode_cursor *c,
         * Write the object set itself.  The saved block pointer will be copied
         * into the referencing DSL dataset or the uberblocks.
         */
-       vdev_pwrite_data(zfs, DMU_OT_OBJSET, ZIO_CHECKSUM_FLETCHER_4, 0, 1,
-           os->phys, os->osblksz, os->osloc, &os->osbp);
+       vdev_pwrite_data(zfs, DMU_OT_OBJSET, ZIO_CHECKSUM_FLETCHER_4, 0,
+           os->dnodecount - 1, os->phys, os->osblksz, os->osloc, &os->osbp);
 }
 
 void

Reply via email to