Bug ID: 236043
Summary: bectl can't destroy origin snapshot
Product: Base System
Severity: Affects Some People
Assignee: [hidden email] Reporter: [hidden email]
The bug is in the libbe library, specifically the 'be_destroy' function.
'be_destroy' can destroy
a boot environment by name or snapshot, in either case 'be_destroy' acquires a
zfs handle internally. When
'be_destroy' is given a boot environment name, the zfs handle will be the boot
environment dataset (zroot/ROOT/bootenv).
When 'be_destroy' is given a snapshot name, the zfs handle will be the dataset
that the snapshot was
taken from (zroot/ROOT/solid). After the zfs handle is acquired, a check is
made to see if the dataset
is mounted and bombs if it is (unless forced). In the above case,
'zroot/ROOT/solid' is the current boot environment.
In short - when destroying a snapshot, 'be_destroy' tries to unmount the
dataset that the snapshot was
taken from. The attached fix checks if the dataset is mounted only when that
dataset (i.e. boot environment) will
be destroyed. In other words, the patch doesn't check if a dataset is mounted
when destroying a snapshot.