Page MenuHomeFreeBSD

libbe: recursively promote deep BE datasets
ClosedPublic

Authored by rcm on Jul 11 2023, 11:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 6:02 AM
Unknown Object (File)
Sun, May 5, 6:40 AM
Unknown Object (File)
Thu, May 2, 3:38 PM
Unknown Object (File)
Thu, May 2, 3:31 PM
Unknown Object (File)
Thu, May 2, 3:31 PM
Unknown Object (File)
Thu, May 2, 3:29 PM
Unknown Object (File)
Thu, May 2, 3:29 PM
Unknown Object (File)
Thu, May 2, 3:29 PM
Subscribers

Details

Summary

beadm will recursively promote deep BE datasets. In order to match the bedam
behavior, we need to recursively iterate over child filesystems and promote them
along the way.

This patch further refines the work at https://reviews.freebsd.org/D40903

Sponsored by: Rubicon Communications, LLC ("Netgate")

Test Plan

The test case introduced in https://reviews.freebsd.org/D40903 has been
modified to test a simple deep BE case.

Diff Detail

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

Event Timeline

rcm requested review of this revision.Jul 11 2023, 11:34 AM
rcm added a reviewer: rew.

For future diffs, please include full context (-U999999) or use arc

lib/libbe/be.c
1323

I'm torn on whether we want to do it this way, or if we want to additionally push the origin check into be_zfs_promote_cb and keep running be_zfs_promote until we don't have any more cloned datasets to promote, just in case the sysadmin's done something crazy with some subordinates.

For future diffs, please include full context (-U999999) or use arc

Thanks, I will do that moving forward

Added full context

rcm updated this revision to Diff 124518.
rcm marked an inline comment as done.
lib/libbe/be.c
1323

I agree. I have addressed this case in my latest diff.

be_zfs_promote now returns a bool that can be used to determine if we encountered a dataset with an origin property set. If we did, we promote it and then iterate again, steeping deeper until we walk the tree without encountering a dataset with an origin prop.

Just a couple small style(9)-ish comments, but I can address these pre-commit. I think I'm happy with this version, though I might amend the test to, after the basics are verified as written, manually promote one of the two datasets so that we need two rounds for one dataset, one for the other, and make sure we get both done without an error.

lib/libbe/be.c
1273

No space between closing parenthesis and data

1277

Hanging line should be tabbed to the same level + 4 spaces, rather than the two tabs here

1278

No parentheses here

1290

No parentheses here

1291

No space between closing parenthesis and found-origin

rcm marked 5 inline comments as done.

I have updated the diff with the style(9) changes suggested

lib/libbe/be.c
1273

Thanks

1277

Thanks

1278

Thanks

1290

Thanks

1291

Thanks

I think I'm happy with this; will give others ~half a day or so more to object.

This revision is now accepted and ready to land.Jul 13 2023, 4:29 AM
This revision was automatically updated to reflect the committed changes.