Bug 232488 - bectl reports error confusing error when activating boot environment
Summary: bectl reports error confusing error when activating boot environment
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Kyle Evans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-20 20:16 UTC by bkidney@briankidney.ca
Modified: 2018-11-05 18:13 UTC (History)
3 users (show)

See Also:


Attachments
svn(1) diff against head (887 bytes, patch)
2018-10-23 14:34 UTC, Kyle Evans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bkidney@briankidney.ca 2018-10-20 20:16:20 UTC
When I try to activate the original boot environment on my system using the command

sudo bectl activate 12.0-ALPHA8

(environment was renamed from default)

it is reported as unsuccessful. The follow error is printed to stderr:

cannot promote 'zroot/ROOT/12.0-ALPHA8': not a cloned filesystem
Comment 1 Shawn Webb 2018-10-20 20:54:29 UTC
That makes sense. When I wrote the promotion-upon-activation, I didn't take that kind of condition into account. I'll try to come up with a fix tonight or tomorrow.
Comment 2 Shawn Webb 2018-10-20 21:42:17 UTC
Essentially, what needs to happen is look for the `clones` ZFS property of the to-be-activated BE. Only promote when the `clones` property is non-NULL and contains a string of a length greater than 0.
Comment 3 Shawn Webb 2018-10-20 22:40:35 UTC
s/clones/origin/
Comment 4 Kyle Evans freebsd_committer freebsd_triage 2018-10-23 14:34:11 UTC
Created attachment 198499 [details]
svn(1) diff against head

Hi,

Attached patch should address. "origin" property is used to reflect base snapshot used for this dataset- if property exists, we should promote. This seems to do the right thing for me.
Comment 5 bkidney@briankidney.ca 2018-11-01 13:52:42 UTC
The posted patch works for me.
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-11-01 14:01:03 UTC
A commit references this bug:

Author: kevans
Date: Thu Nov  1 14:00:56 UTC 2018
New revision: 339994
URL: https://svnweb.freebsd.org/changeset/base/339994

Log:
  libbe(3): Don't promote non-cloned BEs

  Most easily reproducible by attempting to activate the currently activated
  BE, one would get a "not a cloned filesystem" error instead of success or a
  sane message.

  PR:		232488
  MFC after:	3 days

Changes:
  head/lib/libbe/be.c
Comment 7 Kyle Evans freebsd_committer freebsd_triage 2018-11-01 14:02:45 UTC
Thanks! I'll MFC this in due time for 12.0.
Comment 8 commit-hook freebsd_committer freebsd_triage 2018-11-05 18:13:43 UTC
A commit references this bug:

Author: kevans
Date: Mon Nov  5 18:12:41 UTC 2018
New revision: 340154
URL: https://svnweb.freebsd.org/changeset/base/340154

Log:
  MFC r339994: libbe(3): Don't promote non-cloned BEs

  Most easily reproducible by attempting to activate the currently activated
  BE, one would get a "not a cloned filesystem" error instead of success or a
  sane message.

  PR:		232488
  Approved by:	re (gjb)

Changes:
_U  stable/12/
  stable/12/lib/libbe/be.c