Page MenuHomeFreeBSD

libbe: promote activated BEs all the way
ClosedPublic

Authored by kevans on Jul 7 2023, 12:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 2, 2:06 AM
Unknown Object (File)
Fri, Apr 26, 6:35 PM
Unknown Object (File)
Thu, Apr 25, 4:13 PM
Unknown Object (File)
Thu, Apr 25, 4:13 PM
Unknown Object (File)
Thu, Apr 25, 3:41 PM
Unknown Object (File)
Tue, Apr 9, 7:10 PM
Unknown Object (File)
Feb 16 2024, 9:31 PM
Unknown Object (File)
Feb 12 2024, 4:01 PM
Subscribers

Details

Summary

This matches the beadm behavior; generally, we need to keep promoting
until the BE is no longer a clone from a snapshot. This fixes scenarios
where the dataset associated with a BE's origin is itself a clone,
activating the BE previously would promote it to a clone of the origin's
origin.

We could keep using be_get_dataset_props here, except for two
annoyances:

1.) I couldn't find a clean way to just clear an nvlist rather than

having to re-alloc it, and I didn't want to just remove the one prop
we're inspecting out of it.

2.) That's a lot of overhead when all we want to do is fetch the origin

anyways.

Reported by: R. Christian McDonald <rcm@rcm.sh>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This looks good to me, it fixes the case I was hitting.

This revision is now accepted and ready to land.Jul 7 2023, 11:52 AM
rcm requested changes to this revision.EditedJul 10 2023, 8:32 PM

This does not completely align with beadm behavior.

Consider a default boot environment with a child dataset like:

zroot/ROOT/default
zroot/ROOT/default/usr

beadm will recursively promote both the parent and any child datasets.

We need to do the same. I have a patch and updated test case for this.

This revision now requires changes to proceed.Jul 10 2023, 8:32 PM
This revision was not accepted when it landed; it landed in state Needs Revision.Jul 11 2023, 5:45 AM
This revision was automatically updated to reflect the committed changes.