git: ea5173e57255 - stable/14 - makefs/zfs: Set the objset block pointer fill field correctly
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 04 Oct 2023 13:43:50 UTC
The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ea5173e5725564da4b95a5b98410b8cd43520dab commit ea5173e5725564da4b95a5b98410b8cd43520dab Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2023-09-27 15:56:33 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2023-10-04 13:42:14 +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 (cherry picked from commit 46402fd21631b7d4686f8c341d92db6bcb190e5d) --- 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