]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/spa_misc.c
OpenZFS 8961 - SPA load/import should tell us why it failed
authorPavel Zakharov <pavel.zakharov@delphix.com>
Thu, 10 Mar 2016 15:16:02 +0000 (10:16 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 9 May 2018 04:30:10 +0000 (21:30 -0700)
commit4a0ee12af8967a859c3607530aaef466e21cebc3
treeae5079139035cfa72fdc0e4673775954ab9f8206
parentca0845d59efe5881d14e0bb90603a5152eb07227
OpenZFS 8961 - SPA load/import should tell us why it failed

Problem
=======

When we fail to open or import a storage pool, we typically don't
get any additional diagnostic information, just "no pool found" or
"can not import".

While there may be no additional user-consumable information, we should
at least make this situation easier to debug/diagnose for developers
and support.  For example, we could start by using `zfs_dbgmsg()`
to log each thing that we try when importing, and which things
failed. E.g. "tried uberblock of txg X from label Y of device Z". Also,
we could log each of the stages that we go through in `spa_load_impl()`.

Solution
========

Following the cleanup to `spa_load_impl()`, debug messages have been
added to every point of failure in that function. Additionally,
debug messages have been added to strategic places, such as
`vdev_disk_open()`.

Authored by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Ported-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Tim Chase <tim@chase2k.com>
OpenZFS-issue: https://illumos.org/issues/8961
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/418079e0
Closes #7459
include/sys/spa.h
include/sys/vdev.h
module/zfs/spa.c
module/zfs/spa_misc.c
module/zfs/vdev.c
module/zfs/vdev_disk.c
module/zfs/vdev_label.c