Skip to content

fix: zfs-initramfs breakages after recent refactor - #18442

Closed
lowjoel wants to merge 2 commits into
openzfs:masterfrom
lowjoel:fix-zfs-initramfs
Closed

lowjoel wants to merge 2 commits into
openzfs:masterfrom
lowjoel:fix-zfs-initramfs

Conversation

@lowjoel

@lowjoel lowjoel commented Apr 18, 2026 •

Copy link
Copy Markdown
Contributor

Motivation and Context

I was porting my zsys patches on my PPA and was running the resulting code changes by Claude for a review. Some changes were only in my patch, others were found to be in the upstream repository. Pushing those fixes here. I've also added the Co-authored-by tag (hopefully in compliance with policy). The problems were identified by Claude but I did the fixes by hand.

Description

See individual commits. They fix some identifier mix-ups in 61ab032 and 33dd57e.

This should also be a candidate for backporting to 2.4.x

How Has This Been Tested?

Mostly by static analysis of the comments and context. I've rebooted my machine with the new initramfs and cursorily it seems to work. Arguably, that won't tell us what we already know -- that this only affects the rollback path.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Copilot AI review requested due to automatic review settings April 18, 2026 02:18
Fixes regression introduced by 33dd57e.

Co-Authored-By: Claude Sonnet 4.6 
Signed-off-by: Joel Low 
@lowjoel
lowjoel force-pushed the fix-zfs-initramfs branch from edd9fd4 to 8e74b45 Compare April 18, 2026 02:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes initramfs ZFS boot script regressions introduced by recent refactors, primarily around using the correct identifiers when destroying datasets and when prompting for a snapshot during snapshot-boot flows.

Changes:

  • Fix destroy_fs() to consistently use its local _destroy_fs argument when logging and constructing the destroy command.
  • Fix snapshot selection to update _boot_snap (the variable actually used later) when prompting the user.
  • Fix dataset destruction loop to destroy each listed dataset (fs) rather than repeatedly destroying _boot_snap.
Comments suppressed due to low confidence (1)

contrib/initramfs/scripts/zfs:681

  • The comment about splitting the snapshot still refers to ${snap}, but the actual variable used here is _boot_snap. Updating the comment (and fixing “it's”→“its”) would avoid confusion when maintaining this function.
		_boot_snap="$(ask_user_snap "${_boot_snap%%@*}")"
	fi

	# Separate the full snapshot ('${snap}') into it's filesystem and
	# snapshot names. Would have been nice with a split() function..

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Fixes regression introduced by 61ab032.

Co-Authored-By: Claude Sonnet 4.6 
Signed-off-by: Joel Low 
@lowjoel
lowjoel force-pushed the fix-zfs-initramfs branch from 8e74b45 to ea6475d Compare April 18, 2026 02:42
@lowjoel

lowjoel commented Apr 19, 2026

Copy link
Copy Markdown
Contributor Author

zloop failures hopefully are unrelated: don't believe an initramfs change can change zloop results

@behlendorf behlendorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this up. Yeah, the zloop failure is unrelated.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Apr 20, 2026
behlendorf pushed a commit that referenced this pull request Apr 20, 2026
Fixes regression introduced by 61ab032.

Reviewed-by: Brian Behlendorf 
Co-Authored-By: Claude Sonnet 4.6 
Signed-off-by: Joel Low 
Closes #18442
@lowjoel lowjoel mentioned this pull request May 9, 2026
14 tasks
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request May 11, 2026
Fixes regression introduced by 61ab032.

Reviewed-by: Brian Behlendorf 
Co-Authored-By: Claude Sonnet 4.6 
Signed-off-by: Joel Low 
Closes openzfs#18442
lundman pushed a commit to openzfsonosx/openzfs-fork that referenced this pull request Jul 30, 2026
Fixes regression introduced by 33dd57e.

Reviewed-by: Brian Behlendorf 
Co-Authored-By: Claude Sonnet 4.6 
Signed-off-by: Joel Low 
Closes openzfs#18442
lundman pushed a commit to openzfsonosx/openzfs-fork that referenced this pull request Jul 30, 2026
Fixes regression introduced by 61ab032.

Reviewed-by: Brian Behlendorf 
Co-Authored-By: Claude Sonnet 4.6 
Signed-off-by: Joel Low 
Closes openzfs#18442
pull Bot pushed a commit to A-Archives-and-Forks/openzfs that referenced this pull request Sep 26, 2026
Fixes regression introduced by 33dd57e.

Reviewed-by: Brian Behlendorf 
Co-Authored-By: Claude Sonnet 4.6 
Signed-off-by: Joel Low 
Closes openzfs#18442
pull Bot pushed a commit to A-Archives-and-Forks/openzfs that referenced this pull request Sep 26, 2026
Fixes regression introduced by 61ab032.

Reviewed-by: Brian Behlendorf 
Co-Authored-By: Claude Sonnet 4.6 
Signed-off-by: Joel Low 
Closes openzfs#18442
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Accepted Ready to integrate (reviewed, tested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants