Print this page
3818 zpool status -x should report pools with removed l2arc devices
Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com>
Reviewed by: George Wilson <gwilson@zfsmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libzfs/common/libzfs_status.c
          +++ new/usr/src/lib/libzfs/common/libzfs_status.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright (c) 2012 by Delphix. All rights reserved.
       25 + * Copyright (c) 2013 Steven Hartland. All rights reserved.
  25   26   */
  26   27  
  27   28  /*
  28   29   * This file contains the functions which analyze the status of a pool.  This
  29   30   * include both the status of an active pool, as well as the status exported
  30   31   * pools.  Returns one of the ZPOOL_STATUS_* defines describing the status of
  31   32   * the pool.  This status is independent (to a certain degree) from the state of
  32   33   * the pool.  A pool's state describes only whether or not it is capable of
  33   34   * providing the necessary fault tolerance for data.  The status describes the
  34   35   * overall status of devices.  A pool that is online can still have a device
↓ open down ↓ 108 lines elided ↑ open up ↑
 143  144                  verify(nvlist_lookup_uint64_array(vdev, ZPOOL_CONFIG_VDEV_STATS,
 144  145                      (uint64_t **)&vs, &c) == 0);
 145  146  
 146  147                  if (func(vs->vs_state, vs->vs_aux,
 147  148                      vs->vs_read_errors +
 148  149                      vs->vs_write_errors +
 149  150                      vs->vs_checksum_errors))
 150  151                          return (B_TRUE);
 151  152          }
 152  153  
      154 +        /*
      155 +         * Check any L2 cache devs
      156 +         */
      157 +        if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_L2CACHE, &child,
      158 +            &children) == 0) {
      159 +                for (c = 0; c < children; c++)
      160 +                        if (find_vdev_problem(child[c], func))
      161 +                                return (B_TRUE);
      162 +        }
      163 +
 153  164          return (B_FALSE);
 154  165  }
 155  166  
 156  167  /*
 157  168   * Active pool health status.
 158  169   *
 159  170   * To determine the status for a pool, we make several passes over the config,
 160  171   * picking the most egregious error we find.  In order of importance, we do the
 161  172   * following:
 162  173   *
↓ open down ↓ 277 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX