Print this page
4574 get_clones_stat does not call zap_count in non-debug kernel
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Marcel Telka <marcel@telka.sk>
Approved by:

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/dsl_dataset.c
          +++ new/usr/src/uts/common/fs/zfs/dsl_dataset.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   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright (c) 2013 by Delphix. All rights reserved.
  24   24   * Copyright (c) 2012, Joyent, Inc. All rights reserved.
       25 + * Copyright (c) 2014 RackTop Systems.
  25   26   */
  26   27  
  27   28  #include <sys/dmu_objset.h>
  28   29  #include <sys/dsl_dataset.h>
  29   30  #include <sys/dsl_dir.h>
  30   31  #include <sys/dsl_prop.h>
  31   32  #include <sys/dsl_synctask.h>
  32   33  #include <sys/dmu_traverse.h>
  33   34  #include <sys/dmu_impl.h>
  34   35  #include <sys/dmu_tx.h>
↓ open down ↓ 1322 lines elided ↑ open up ↑
1357 1358          nvlist_t *val = fnvlist_alloc();
1358 1359  
1359 1360          ASSERT(dsl_pool_config_held(ds->ds_dir->dd_pool));
1360 1361  
1361 1362          /*
1362 1363           * There may be missing entries in ds_next_clones_obj
1363 1364           * due to a bug in a previous version of the code.
1364 1365           * Only trust it if it has the right number of entries.
1365 1366           */
1366 1367          if (ds->ds_phys->ds_next_clones_obj != 0) {
1367      -                ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj,
     1368 +                VERIFY0(zap_count(mos, ds->ds_phys->ds_next_clones_obj,
1368 1369                      &count));
1369 1370          }
1370 1371          if (count != ds->ds_phys->ds_num_children - 1)
1371 1372                  goto fail;
1372 1373          for (zap_cursor_init(&zc, mos, ds->ds_phys->ds_next_clones_obj);
1373 1374              zap_cursor_retrieve(&zc, &za) == 0;
1374 1375              zap_cursor_advance(&zc)) {
1375 1376                  dsl_dataset_t *clone;
1376 1377                  char buf[ZFS_MAXNAMELEN];
1377 1378                  VERIFY0(dsl_dataset_hold_obj(ds->ds_dir->dd_pool,
↓ open down ↓ 1643 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX