Bug 188328

Summary: [zfs] UPDATING should provide caveats for running `zpool upgrade`
Product: Base System Reporter: Chris Nehren <cnehren+freebsd-bugs>
Component: kernAssignee: Steven Hartland <smh>
Status: Closed FIXED    
Severity: Affects Only Me CC: ari, jan.kokemueller, smh
Priority: Normal    
Version: 10.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Untested patch that adds the missing bootcode upgrade warning none

Description Chris Nehren 2014-04-06 22:20:00 UTC
Eager sysadmins like to upgrade their ZFS pool versions and then reboot.
This can cause problems if one doesn't update the gpart bootcode. I
presently have a workstation I can't boot because I didn't realize I
needed to do this. Putting this information in UPDATING for every
relevant feature flag change would save people like me rather a lot of
time and frustration.

Fix: 

A mailing list post
(http://lists.freebsd.org/pipermail/freebsd-current/2014-January/047639.html)
suggests upgrading the bootcode should be sufficient. This needs to get
into UPDATING because foregoing this step leaves a system not bootable.
How-To-Repeat: Install 10-RELEASE with ZFS root. Upgrade to 10-STABLE after the new
feature flags from Delphix went in. Reboot. Witness gptzfsboot being
unable to import the bootpool.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-04-16 02:34:11 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 ari 2014-06-08 03:54:50 UTC
Seems unnecessary since 'zpool upgrade' already spits out exactly what you need to do with an appropriate warning.
Comment 3 Jan Kokemüller 2014-09-21 18:27:39 UTC
Created attachment 147531 [details]
Untested patch that adds the missing bootcode upgrade warning

I've just had the same problem after upgrading my bootpool on 10-stable. I used "zpool upgrade -a". I was already on pool version 5000; only some feature flags were added. The problematic feature flags not recognized by the bootloader were "com.delphix:hole_birth" and "com.delphix:embedded_data".

I was aware of the "gpart bootcode" dance but "zpool upgrade -a" definitely showed no message so I assumed it was safe to reboot without upgrading the bootloader. I've looked at the zpool code and it seems that in the case of "zpool upgrade -a" the bootcode upgrade warning may not be displayed. I've attached a patch that should fix it (untested, but it compiles).
Comment 4 Steven Hartland freebsd_committer freebsd_triage 2014-09-21 19:32:45 UTC
Fixed in head by:
http://svnweb.freebsd.org/changeset/base/271934
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-09-24 10:00:24 UTC
A commit references this bug:

Author: smh
Date: Wed Sep 24 09:59:49 UTC 2014
New revision: 272063
URL: http://svnweb.freebsd.org/changeset/base/272063

Log:
  MFC r271934:
  Output boot code warning when zpool upgrade -a is used to add features.

  PR:		188328
  Approved by:	re (marius)
  Sponsored by:	Multiplay

Changes:
_U  stable/10/
  stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c