freebsd-skq/lib/libbe
Kyle Evans be7dd42376 libbe(3): Fix be_destroy behavior w.r.t. deep BE snapshots and -o
be_destroy is documented to recursively destroy a boot environment.  In the
case of snapshots, one would take this to mean that these are also
recursively destroyed.  However, this was previously not the case.
be_destroy would descend into the be_destroy callback and attempt to
zfs_iter_children on the top-level snapshot, which is bogus.

Our alternative approach is to take note of the snapshot name and iterate
through all of fs children of the BE to try destruction in the children.

The -o option is also fixed to work properly with deep BEs.  If the BE was
created with `bectl create -e otherDeepBE newDeepBE`, for instance, then a
recursive snapshot of otherDeepBE would have been taken for construction of
newDeepBE but a subsequent destroy with BE_DESTROY_ORIGIN set would only
clean up the snapshot at the root of otherDeepBE: ${BEROOT}/otherDeepBE@...

The most recent iteration instead pretends not to know how these things
work, verifies that the origin is another BE and then passes that back
through be_destroy to DTRT when snapshots and deep BEs may be in play.

MFC after:	1 week
2019-02-13 04:19:08 +00:00
..
be_access.c libbe(3): Change be_mount to mount/unmount child datasets 2019-01-10 03:27:20 +00:00
be_error.c libbe(3): Fix be_destroy behavior w.r.t. deep BE snapshots and -o 2019-02-13 04:19:08 +00:00
be_impl.h libbe(3): move altroot augmentation bits around a little bit 2019-01-09 22:31:10 +00:00
be_info.c bectl(3)/libbe(3): Allow BE root to be specified 2018-11-19 02:12:08 +00:00
be.c libbe(3): Fix be_destroy behavior w.r.t. deep BE snapshots and -o 2019-02-13 04:19:08 +00:00
be.h libbe(3): Fix be_destroy behavior w.r.t. deep BE snapshots and -o 2019-02-13 04:19:08 +00:00
libbe.3 libbe(3): Fix be_destroy behavior w.r.t. deep BE snapshots and -o 2019-02-13 04:19:08 +00:00
Makefile libbe(3)/bectl(8): Make consistent with beadm 2018-08-24 20:44:58 +00:00