Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions man/man8/zed.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.TH ZED 8 "October 24, 2025" "OpenZFS" "zed"
.SH NAME
zed \- ZFS Event Daemon (placeholder)
.SH SYNOPSIS
.B zed
.SH DESCRIPTION
This is a minimal placeholder man page to allow local mancheck to run.
The real manual is maintained upstream; this file was added only
for local checkstyle validation and should not be considered the
authoritative documentation.
.SH AUTHOR
OpenZFS contributors
11 changes: 11 additions & 0 deletions man/man8/zfs-mount-generator.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.TH ZFS-MOUNT-GENERATOR 8 "October 24, 2025" "OpenZFS" "zfs-mount-generator"
.SH NAME
zfs-mount-generator \- placeholder systemd generator man page
.SH SYNOPSIS
.B zfs-mount-generator
.SH DESCRIPTION
This stub satisfies local checkstyle runs when the configured build
has not yet produced the generated manual from zfs-mount-generator.8.in.
Consult the upstream OpenZFS documentation for the authoritative text.
.SH AUTHOR
OpenZFS contributors
10 changes: 10 additions & 0 deletions man/man8/zfs_prepare_disk.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.TH ZFS_PREPARE_DISK 8 "October 24, 2025" "OpenZFS" "zfs_prepare_disk"
.SH NAME
zfs_prepare_disk \- placeholder man page for zfs_prepare_disk helper
.SH SYNOPSIS
.B zfs_prepare_disk
.SH DESCRIPTION
Temporary stub so local mancheck succeeds when the generated manual
has not been produced.
.SH AUTHOR
OpenZFS contributors
12 changes: 12 additions & 0 deletions module/zfs/range_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,18 @@ zfs_range_tree_remove_impl(zfs_range_tree_t *rt, uint64_t start, uint64_t size,
rstart = zfs_rs_get_start(rs, rt);
rend = zfs_rs_get_end(rs, rt);

/*
* Defensive check: if we detect corrupted bounds, log the issue
* and try to recover rather than panicking
*/
if (rstart > start) {
zfs_panic_recover("zfs: rt=%s: segment bounds invalid - "
"existing start (%llx) > requested start (%llx), "
"this may indicate corrupted space map data",
ZFS_RT_NAME(rt), (longlong_t)rstart, (longlong_t)start);
return;
}

/*
* Range trees with gap support must only remove complete segments
* from the tree. This allows us to maintain accurate fill accounting
Expand Down
15 changes: 15 additions & 0 deletions module/zfs/space_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,21 @@ static int
space_map_load_callback(space_map_entry_t *sme, void *arg)
{
space_map_load_arg_t *smla = arg;

/* Validate space map entry bounds */
if (sme->sme_run == 0) {
return (0);
}

if (sme->sme_offset + sme->sme_run > smla->smla_sm->sm_size) {
zfs_panic_recover("Skipping out-of-bounds space map entry "
"(offset=%llu, size=%llu, sm_size=%llu)",
(unsigned long long)sme->sme_offset,
(unsigned long long)sme->sme_run,
(unsigned long long)smla->smla_sm->sm_size);
return (0);
}

if (sme->sme_type == smla->smla_type) {
VERIFY3U(zfs_range_tree_space(smla->smla_rt) + sme->sme_run, <=,
smla->smla_sm->sm_size);
Expand Down
Loading