Print this page
NEX-5736 implement autoreplace matching based on FRU slot number
NEX-6200 hot spares are not reactivated after reinserting into enclosure
NEX-9403 need to update FRU for spare and l2cache devices
NEX-9404 remove lofi autoreplace support from syseventd
NEX-9409 hotsparing doesn't work for vdevs without FRU
NEX-9424 zfs`vdev_online() needs better notification about state changes
Portions contributed by: Alek Pinchuk <alek@nexenta.com>
Portions contributed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Steve Peng <steve.peng@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
NEX-9228 libzfs`add_config() leaks config nvl when reading spare/l2cache devices
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
1778 Assertion failed: rn->rn_nozpool == B_FALSE, file ../common/libzfs_import.c, line 1077, function zpool_open_func
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Approved by: Gordon Ross <gordon.ross@nexenta.com>
NEX-2997 Memory leaks in libzfs import implementation
Reviewed by: Dan Fields <dan.fields@nexenta.com>
NEX-1557 Parallel mount during HA Failover sometimes doesn't share the dataset, causes shares to go offline

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libzfs/common/libzfs_import.c
          +++ new/usr/src/lib/libzfs/common/libzfs_import.c
↓ open down ↓ 404 lines elided ↑ open up ↑
 405  405  }
 406  406  
 407  407  /*
 408  408   * Convert our list of pools into the definitive set of configurations.  We
 409  409   * start by picking the best config for each toplevel vdev.  Once that's done,
 410  410   * we assemble the toplevel vdevs into a full config for the pool.  We make a
 411  411   * pass to fix up any incorrect paths, and then add it to the main list to
 412  412   * return to the user.
 413  413   */
 414  414  static nvlist_t *
 415      -get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok,
 416      -    nvlist_t *policy)
      415 +get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok)
 417  416  {
 418  417          pool_entry_t *pe;
 419  418          vdev_entry_t *ve;
 420  419          config_entry_t *ce;
 421  420          nvlist_t *ret = NULL, *config = NULL, *tmp = NULL, *nvtop, *nvroot;
 422  421          nvlist_t **spares, **l2cache;
 423  422          uint_t i, nspares, nl2cache;
 424  423          boolean_t config_seen;
 425  424          uint64_t best_txg;
 426  425          char *name, *hostname = NULL;
↓ open down ↓ 313 lines elided ↑ open up ↑
 740  739  
 741  740                  if (pool_active(hdl, name, guid, &isactive) != 0)
 742  741                          goto error;
 743  742  
 744  743                  if (isactive) {
 745  744                          nvlist_free(config);
 746  745                          config = NULL;
 747  746                          continue;
 748  747                  }
 749  748  
 750      -                if (policy != NULL) {
 751      -                        if (nvlist_add_nvlist(config, ZPOOL_REWIND_POLICY,
 752      -                            policy) != 0)
 753      -                                goto nomem;
 754      -                }
 755      -
 756  749                  if ((nvl = refresh_config(hdl, config)) == NULL) {
 757  750                          nvlist_free(config);
 758  751                          config = NULL;
 759  752                          continue;
 760  753                  }
 761  754  
 762  755                  nvlist_free(config);
 763  756                  config = nvl;
 764  757  
 765  758                  /*
↓ open down ↓ 91 lines elided ↑ open up ↑
 857  850          int l;
 858  851          vdev_label_t *label;
 859  852          uint64_t state, txg, size;
 860  853  
 861  854          *config = NULL;
 862  855  
 863  856          if (fstat64(fd, &statbuf) == -1)
 864  857                  return (-1);
 865  858          size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t);
 866  859  
 867      -        if ((label = malloc(sizeof (vdev_label_t))) == NULL)
      860 +        if ((label = calloc(sizeof (vdev_label_t), 1)) == NULL)
 868  861                  return (-1);
 869  862  
 870  863          for (l = 0; l < VDEV_LABELS; l++) {
 871  864                  if (pread64(fd, label, sizeof (vdev_label_t),
 872  865                      label_offset(size, l)) != sizeof (vdev_label_t))
 873  866                          continue;
 874  867  
 875  868                  if (nvlist_unpack(label->vl_vdev_phys.vp_nvlist,
 876  869                      sizeof (label->vl_vdev_phys.vp_nvlist), config, 0) != 0)
 877  870                          continue;
↓ open down ↓ 373 lines elided ↑ open up ↑
1251 1244                          free(slice);
1252 1245                  }
1253 1246                  avl_destroy(&slice_cache);
1254 1247  
1255 1248                  (void) closedir(dirp);
1256 1249  
1257 1250                  if (config_failed)
1258 1251                          goto error;
1259 1252          }
1260 1253  
1261      -        ret = get_configs(hdl, &pools, iarg->can_be_active, iarg->policy);
     1254 +        ret = get_configs(hdl, &pools, iarg->can_be_active);
1262 1255  
1263 1256  error:
1264 1257          for (pe = pools.pools; pe != NULL; pe = penext) {
1265 1258                  penext = pe->pe_next;
1266 1259                  for (ve = pe->pe_vdevs; ve != NULL; ve = venext) {
1267 1260                          venext = ve->ve_next;
1268 1261                          for (ce = ve->ve_configs; ce != NULL; ce = cenext) {
1269 1262                                  cenext = ce->ce_next;
1270 1263                                  nvlist_free(ce->ce_config);
1271 1264                                  free(ce);
↓ open down ↓ 109 lines elided ↑ open up ↑
1381 1374  
1382 1375                  if (pool_active(hdl, name, this_guid, &active) != 0) {
1383 1376                          nvlist_free(raw);
1384 1377                          nvlist_free(pools);
1385 1378                          return (NULL);
1386 1379                  }
1387 1380  
1388 1381                  if (active)
1389 1382                          continue;
1390 1383  
1391      -                if (nvlist_add_string(src, ZPOOL_CONFIG_CACHEFILE,
1392      -                    cachefile) != 0) {
1393      -                        (void) no_memory(hdl);
1394      -                        nvlist_free(raw);
1395      -                        nvlist_free(pools);
1396      -                        return (NULL);
1397      -                }
1398      -
1399 1384                  if ((dst = refresh_config(hdl, src)) == NULL) {
1400 1385                          nvlist_free(raw);
1401 1386                          nvlist_free(pools);
1402 1387                          return (NULL);
1403 1388                  }
1404 1389  
1405 1390                  if (nvlist_add_nvlist(pools, nvpair_name(elem), dst) != 0) {
1406 1391                          (void) no_memory(hdl);
1407 1392                          nvlist_free(dst);
1408 1393                          nvlist_free(raw);
↓ open down ↓ 284 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX