Page MenuHomeFreeBSD

libbe(3): promote dependent clones when destroying an environment
ClosedPublic

Authored by jwmaag_gmail.com on Dec 29 2019, 5:09 AM.
Tags
None
Referenced Files
F106064138: D22953.diff
Tue, Dec 24, 7:04 PM
Unknown Object (File)
Tue, Nov 26, 6:10 AM
Unknown Object (File)
Nov 6 2024, 2:03 PM
Unknown Object (File)
Nov 5 2024, 3:56 PM
Unknown Object (File)
Oct 26 2024, 8:58 PM
Unknown Object (File)
Oct 12 2024, 6:06 PM
Unknown Object (File)
Oct 12 2024, 6:05 PM
Unknown Object (File)
Oct 1 2024, 3:40 PM
Subscribers

Details

Summary

When removing a boot environment iterate over the dependents and
process the snapshots by grabbing any clones. Promote the clones we
found and then remove the target environment.

Test Plan
  • create a boot environment be0
  • create two boot environments from be0 (be1, be2)
  • destroy be0
  • destroy be1
  • create be1 from be0
  • create be2 from be1
  • create be3 from be2
  • destroy be2, be3, be1

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28361
Build 26449: arc lint + arc unit

Event Timeline

jwmaag_gmail.com retitled this revision from Fix boot environment deletion with dependent clones to libbe(3): promote dependent clones when destroying an environment.Dec 29 2019, 5:37 AM

Overall approach LGTM.

lib/libbe/be.c
205

"promote"

223

This initialization should probably be moved down to just before we iterate over the promotelist; once found is set, we're never resetting it back to false.

243

space after if

247

space after if

272

space after while

407

space after if, before opening brace.

sbin/bectl/tests/bectl_test.sh
151

Unwanted trailing space.

fix nits, rearrange promote list unique logic

lib/libbe/be.c
250

newentry is leaked here

252

We should check return value of strdup here, too, while we're at it.

free newentry when following the dup or error path

on allocation failures, set err = enomem and break out of the loop so we clean up any nvlists/zfs handles instead of just returning

This revision was not accepted when it landed; it landed in state Needs Review.Jan 2 2020, 6:46 PM
This revision was automatically updated to reflect the committed changes.