Skip to content

Commit

Permalink
DOSE-838 zpool iostat -o fails assertion when agent dies (openzfs#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
Don Brady authored Dec 9, 2021
1 parent 3b0cbab commit ac7cedc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5097,6 +5097,19 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv,
if (strcmp(name, VDEV_TYPE_INDIRECT) == 0)
return (ret);

/*
* When asked to display object store stats (-o), make sure the
* expected stats still exist. If they are missing we can skip
* printing this line and pick up on the next iteration.
*/
if (cb->cb_flags & IOS_OBJECT_ANY_M) {
if (!nvlist_exists(newnv, ZPOOL_CONFIG_OBJECT_STORE_STATS) ||
(oldnv != NULL &&
!nvlist_exists(oldnv, ZPOOL_CONFIG_OBJECT_STORE_STATS))) {
return (ret);
}
}

calcvs = safe_malloc(sizeof (*calcvs));

if (oldnv != NULL) {
Expand Down

0 comments on commit ac7cedc

Please sign in to comment.