[Bug 236043] bectl can't destroy origin snapshot

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 236043] bectl can't destroy origin snapshot

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236043

            Bug ID: 236043
           Summary: bectl can't destroy origin snapshot
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: [hidden email]
          Reporter: [hidden email]

Created attachment 202370
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=202370&action=edit
don't check if a dataset is mounted when destroying a snapshot

How to reproduce:

$ bectl create bootenv

$ bectl list -s | grep -A1 bootenv
bootenv
  zroot/ROOT/bootenv                       -      -          8K    2019-02-25
12:45
    zroot/ROOT/solid@2019-02-25-12:45:25   -      -          0     2019-02-25
12:45

$ bectl destroy -o bootenv
cannot destroy mounted boot env unless forced

$ bectl list | grep bootenv
/* no output*/

$ zfs list -t snapshot | grep solid@2019-02-25-12:45:25
zroot/ROOT/solid@2019-02-25-12:45:25                       0      -  21.7G  -

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.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 236043] [patch] bectl can't destroy origin snapshot

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236043

Rob <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|bectl can't destroy origin  |[patch] bectl can't destroy
                   |snapshot                    |origin snapshot

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 236043] bectl can't destroy origin snapshot

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236043

Mark Linimon <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
            Summary|[patch] bectl can't destroy |bectl can't destroy origin
                   |origin snapshot             |snapshot

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 236043] [patch] bectl can't destroy origin snapshot

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236043

Rob <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|bectl can't destroy origin  |[patch] bectl can't destroy
                   |snapshot                    |origin snapshot

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 236043] [patch] bectl can't destroy origin snapshot

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236043

Sergey <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #1 from Sergey <[hidden email]> ---
*** Bug 236006 has been marked as a duplicate of this bug. ***

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 236043] [patch] bectl can't destroy origin snapshot

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236043

Kyle Evans <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
           Assignee|[hidden email]            |[hidden email]

--- Comment #2 from Kyle Evans <[hidden email]> ---
Take

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[hidden email]"