diff options
author | Pavel Zakharov <pavel.zakharov@delphix.com> | 2016-09-14 11:01:40 -0400 |
---|---|---|
committer | Prakash Surya <prakash.surya@delphix.com> | 2018-03-21 08:37:35 -0700 |
commit | b6bf6e1540f30bd97b8d6e2c21d95e17841e0f23 (patch) | |
tree | f534f5124afb8f61a057528a13e7044d6681ab77 | |
parent | de753e34f9c399037936e8bc547d823bba9d4b0d (diff) | |
download | illumos-joyent-b6bf6e1540f30bd97b8d6e2c21d95e17841e0f23.tar.gz |
9189 Add debug to vdev_label_read_config when txg check fails
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
-rw-r--r-- | usr/src/uts/common/fs/zfs/vdev.c | 3 | ||||
-rw-r--r-- | usr/src/uts/common/fs/zfs/vdev_label.c | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/usr/src/uts/common/fs/zfs/vdev.c b/usr/src/uts/common/fs/zfs/vdev.c index 388d13716c..e23e4a01c1 100644 --- a/usr/src/uts/common/fs/zfs/vdev.c +++ b/usr/src/uts/common/fs/zfs/vdev.c @@ -1585,7 +1585,8 @@ vdev_validate(vdev_t *vd) if ((label = vdev_label_read_config(vd, txg)) == NULL) { vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, VDEV_AUX_BAD_LABEL); - vdev_dbgmsg(vd, "vdev_validate: failed reading config"); + vdev_dbgmsg(vd, "vdev_validate: failed reading config for " + "txg %llu", (u_longlong_t)txg); return (0); } diff --git a/usr/src/uts/common/fs/zfs/vdev_label.c b/usr/src/uts/common/fs/zfs/vdev_label.c index 21677dcdc2..d8a0762c42 100644 --- a/usr/src/uts/common/fs/zfs/vdev_label.c +++ b/usr/src/uts/common/fs/zfs/vdev_label.c @@ -540,6 +540,7 @@ vdev_label_read_config(vdev_t *vd, uint64_t txg) abd_t *vp_abd; zio_t *zio; uint64_t best_txg = 0; + uint64_t label_txg = 0; int error = 0; int flags = ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE; @@ -565,8 +566,6 @@ retry: if (zio_wait(zio) == 0 && nvlist_unpack(vp->vp_nvlist, sizeof (vp->vp_nvlist), &label, 0) == 0) { - uint64_t label_txg = 0; - /* * Auxiliary vdevs won't have txg values in their * labels and newly added vdevs may not have been @@ -597,6 +596,15 @@ retry: goto retry; } + /* + * We found a valid label but it didn't pass txg restrictions. + */ + if (config == NULL && label_txg != 0) { + vdev_dbgmsg(vd, "label discarded as txg is too large " + "(%llu > %llu)", (u_longlong_t)label_txg, + (u_longlong_t)txg); + } + abd_free(vp_abd); return (config); |