History log of /freebsd/usr.sbin/makefs/zfs/dsl.c (Results 1 – 13 of 13)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# da125556 22-Jul-2025 Toomas Soome <tsoome@FreeBSD.org>

makefs: clean up warnings

zfs/fs.c:
zfs/objset.c:
zfs/vdev.c:
zfs/zap.c:
Add include sys/param.h

dsl_dir_alloc() needs to set parent = NULL to silence warning
about 'parent' may be used uninitializ

makefs: clean up warnings

zfs/fs.c:
zfs/objset.c:
zfs/vdev.c:
zfs/zap.c:
Add include sys/param.h

dsl_dir_alloc() needs to set parent = NULL to silence warning
about 'parent' may be used uninitialized. Warning is given because
we break the loop when nextdir == NULL and parent was not previously set.
(it should not happen, but compiler does not know that).

zap_add() and zap_fat_write_array_chunk() takes uint8_t *, use type
cast.

zap_fat_write_array_chunk() should check sz for 0 to avoid
use of uninitialized pointer.

unchecked function returns.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D51592

show more ...


# d8f3e878 21-Jul-2025 Mark Johnston <markj@FreeBSD.org>

makefs/zfs: Make it possible to set a compression property

makefs currently does not implement compression for ZFS datasets, as
doing so seems somewhat fraught with compatibility issues. As a resul

makefs/zfs: Make it possible to set a compression property

makefs currently does not implement compression for ZFS datasets, as
doing so seems somewhat fraught with compatibility issues. As a result,
the root dataset has compression disabled, and all others inherit from
that.

However, it may be useful to enable compression for new files once the
generated pool is actually imported. Thus, implement a per-data
compression option. By default, compression is inherited from the
parent dataset and disabled on the root dataset.

Add a regression test.

PR: 288241
MFC after: 1 month

show more ...


Revision tags: release/14.3.0-p1, release/14.2.0-p4, release/13.5.0-p2, release/14.3.0, release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0
# be2f92a9 01-Jun-2024 Mark Johnston <markj@FreeBSD.org>

makefs/zfs: Add a helper function for adding ZAP entries

Some ZAPs are used to represent sets, in which keys and values are the
same. Add a helper function for this case. No functional change
inte

makefs/zfs: Add a helper function for adding ZAP entries

Some ZAPs are used to represent sets, in which keys and values are the
same. Add a helper function for this case. No functional change
intended.

MFC after: 1 week

show more ...


Revision tags: release/14.1.0, release/13.3.0, release/14.0.0
# ef067b57 23-Oct-2023 Mark Johnston <markj@FreeBSD.org>

makefs/zfs: Update dd_used_breakdown after writing the MOS

Fixes: 96092bf9108c ("makefs/zfs: Fill out dd_used_breakdown fields in DSL directories")
Sponsored by: The FreeBSD Foundation


# 96092bf9 23-Oct-2023 Mark Johnston <markj@FreeBSD.org>

makefs/zfs: Fill out dd_used_breakdown fields in DSL directories

This is required for the "used", "usedds" and "usedchild" dataset
properties to be displayed.

PR: 274613
Reported by: Mike Tancsa <

makefs/zfs: Fill out dd_used_breakdown fields in DSL directories

This is required for the "used", "usedds" and "usedchild" dataset
properties to be displayed.

PR: 274613
Reported by: Mike Tancsa <mike@sentex.net>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

show more ...


# 14c5cf3a 26-May-2023 Mark Johnston <markj@FreeBSD.org>

makefs/zfs: Avoid generating a GUID of zero


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


Revision tags: release/13.2.0, release/12.4.0
# 752ba100 28-Oct-2022 Mark Johnston <markj@FreeBSD.org>

makefs: Fix handling of inherited mountpoints

Commit d7eec79b7021 overlooked the fact that
nvlist_find(DATA_TYPE_STRING) does not provide a nul-terminated string.
Fix the leak a different way.

Fixe

makefs: Fix handling of inherited mountpoints

Commit d7eec79b7021 overlooked the fact that
nvlist_find(DATA_TYPE_STRING) does not provide a nul-terminated string.
Fix the leak a different way.

Fixes: d7eec79b7021 ("makefs: Plug a memory leak")

show more ...


# d7eec79b 04-Oct-2022 Mark Johnston <markj@FreeBSD.org>

makefs: Plug a memory leak

nvlist_find_string() would return a copy of the found value, but callers
assumed they would have to make their own copy. It's simpler to change
nvlist_find_string() than

makefs: Plug a memory leak

nvlist_find_string() would return a copy of the found value, but callers
assumed they would have to make their own copy. It's simpler to change
nvlist_find_string() than it is to change callers, so do that.

Reported by: Coverity

show more ...


# c6890399 18-Aug-2022 Jessica Clarke <jrtc27@FreeBSD.org>

makefs: Fix issues building as a cross-tool on non-FreeBSD

This adds missing includes, uses the standard dirent.h rather than the
BSD-specific sys/dirent.h subset (which works on macOS but not Linux

makefs: Fix issues building as a cross-tool on non-FreeBSD

This adds missing includes, uses the standard dirent.h rather than the
BSD-specific sys/dirent.h subset (which works on macOS but not Linux)
and works around Linux's lack of st_birthtim.

This allows usr.sbin/makefs to be added to LOCAL_XTOOL_DIRS again on
macOS and Linux so that disk images can be cross-built.

Reviewed by: markj
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Differential Revision: https://reviews.freebsd.org/D36135

show more ...


# 4f816f5b 16-Aug-2022 Mark Johnston <markj@FreeBSD.org>

makefs: Fix space accounting for the root DSL directory

Space used by the MOS is summed after all on-disk data structures are
finalized, so the MOS DSL directory represents a special case when
count

makefs: Fix space accounting for the root DSL directory

Space used by the MOS is summed after all on-disk data structures are
finalized, so the MOS DSL directory represents a special case when
counting bytes used for each directory. The DSL layer failed to update
the MOS DSL directory's parent, the root directory, accordingly, so the
root directory reported less space used than was used in reality. Be
careful to update the root directory after the MOS is finalized.

PR: 265849
Sponsored by: The FreeBSD Foundation

show more ...


# e2259837 11-Aug-2022 Mark Johnston <markj@FreeBSD.org>

makefs: Fix memory leaks in dsl_dir_finalize_props()

nvstring_get() returns a copy of the string, not a pointer into the
nvlist's internal buffer.

Reported by: Coverity
Fixes: 240afd8c1fcc ("makef

makefs: Fix memory leaks in dsl_dir_finalize_props()

nvstring_get() returns a copy of the string, not a pointer into the
nvlist's internal buffer.

Reported by: Coverity
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Sponsored by: The FreeBSD Foundation

show more ...


# 240afd8c 05-Aug-2022 Mark Johnston <markj@FreeBSD.org>

makefs: Add ZFS support

This allows one to take a staged directory tree and create a file
consisting of a ZFS pool with one or more datasets that contain the
contents of the directory tree. This is

makefs: Add ZFS support

This allows one to take a staged directory tree and create a file
consisting of a ZFS pool with one or more datasets that contain the
contents of the directory tree. This is useful for creating virtual
machine images without using the kernel to create a pool; "zpool create"
requires root privileges and currently is not permitted in jails.
makefs -t zfs also provides reproducible images by using a fixed seed
for pseudo-random number generation, used for generating GUIDs and hash
salts. makefs -t zfs requires relatively little by way of machine
resources.

The "zpool_reguid" rc.conf setting can be used to ask a FreeBSD guest to
generate a unique pool GUID upon first boot.

A small number of pool and dataset properties are supported. The pool
is backed by a single disk vdev. Data is always checksummed using
Fletcher-4, no redundant copies are made, and no compression is used.
The manual page documents supported pool and filesystem properties.

The implementation uses a few pieces of ZFS support from with the boot
loader, especially definitions for various on-disk structures, but is
otherwise standalone and in particular doesn't depend on OpenZFS.

This feature should be treated as experimental for now, i.e., important
data shouldn't be trusted to a makefs-created pool, and the command-line
interface is subject to change.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35248

show more ...