Print this page
NEX-6088 ZFS scrub/resilver take excessively long due to issuing lots of random IO
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.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 ↓ 201 lines elided ↑ open up ↑
 202  202              (uint64_t **)&vs, &vsc) == 0);
 203  203          verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE,
 204  204              &stateval) == 0);
 205  205  
 206  206          /*
 207  207           * Currently resilvering a vdev
 208  208           */
 209  209          (void) nvlist_lookup_uint64_array(nvroot, ZPOOL_CONFIG_SCAN_STATS,
 210  210              (uint64_t **)&ps, &psc);
 211  211          if (ps && ps->pss_func == POOL_SCAN_RESILVER &&
 212      -            ps->pss_state == DSS_SCANNING)
      212 +            (ps->pss_state == DSS_SCANNING || ps->pss_state == DSS_FINISHING))
 213  213                  return (ZPOOL_STATUS_RESILVERING);
 214  214  
 215  215          /*
 216  216           * Pool last accessed by another system.
 217  217           */
 218  218          (void) nvlist_lookup_uint64(config, ZPOOL_CONFIG_HOSTID, &hostid);
 219  219          if (hostid != 0 && (unsigned long)hostid != gethostid() &&
 220  220              stateval == POOL_STATE_ACTIVE)
 221  221                  return (ZPOOL_STATUS_HOSTID_MISMATCH);
 222  222  
↓ open down ↓ 228 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX