A faulted pool with only unavailable vdevs triggers assertion failure in libzfs
Review Request #106 - Created Oct. 19, 2015 and updated - Latest diff uploaded
The problem is that we are asserting that we must have at least some features enabled. But that is not the case when the pool is faulted and we still have it in /etc/zfs/zpool.cache.
When SPA loads it from the cache, it initialises the features structure to NULL, but will never get a chance to actually write anything (all vdevs are unavailable), so it leads to this situation.
The same issue appears when we run zpool upgrade related commands. I believe this is also the root cause for issue #5484.
Followed steps to reproduce from https://www.illumos.org/issues/6358
With this patch:
1. 'zpool get all' no longer crashes and all features supported by the running system as "disabled".
2. 'zpool upgrade' will show all features supported as beeing available to upgrade (as it now thinks that the faulted pool has no features).
3. 'zpool upgrade broken_pool' no longer crashes.