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)
Sun, Oct 20, 3:18 AM
Unknown Object (File)
Oct 1 2024, 4:39 AM
Unknown Object (File)
Sep 16 2024, 5:38 PM
Unknown Object (File)
Sep 15 2024, 10:03 PM
Unknown Object (File)
Sep 5 2024, 8:34 AM
Unknown Object (File)
Aug 14 2024, 10:15 AM
Unknown Object (File)
Aug 4 2024, 3:34 AM
Unknown Object (File)
Aug 4 2024, 3:29 AM
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.