Print this page
re #12611 rb4105 zpool import panic in ddt_zap_count()

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/ddt_zap.c
          +++ new/usr/src/uts/common/fs/zfs/ddt_zap.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  24   25   */
  25   26  
  26   27  #include <sys/zfs_context.h>
  27   28  #include <sys/spa.h>
  28   29  #include <sys/zio.h>
  29   30  #include <sys/ddt.h>
  30   31  #include <sys/zap.h>
  31   32  #include <sys/dmu_tx.h>
  32   33  #include <util/sscanf.h>
  33   34  
↓ open down ↓ 93 lines elided ↑ open up ↑
 127  128                              sizeof (dde->dde_phys));
 128  129                          dde->dde_key = *(ddt_key_t *)za.za_name;
 129  130                  }
 130  131                  zap_cursor_advance(&zc);
 131  132                  *walk = zap_cursor_serialize(&zc);
 132  133          }
 133  134          zap_cursor_fini(&zc);
 134  135          return (error);
 135  136  }
 136  137  
 137      -static uint64_t
 138      -ddt_zap_count(objset_t *os, uint64_t object)
      138 +static int
      139 +ddt_zap_count(objset_t *os, uint64_t object, uint64_t *count)
 139  140  {
 140      -        uint64_t count = 0;
      141 +        int error = zap_count(os, object, count);
      142 +        ASSERT(error == 0);
 141  143  
 142      -        VERIFY(zap_count(os, object, &count) == 0);
 143      -
 144      -        return (count);
      144 +        return (error);
 145  145  }
 146  146  
 147  147  const ddt_ops_t ddt_zap_ops = {
 148  148          "zap",
 149  149          ddt_zap_create,
 150  150          ddt_zap_destroy,
 151  151          ddt_zap_lookup,
 152  152          ddt_zap_prefetch,
 153  153          ddt_zap_update,
 154  154          ddt_zap_remove,
 155  155          ddt_zap_walk,
 156  156          ddt_zap_count,
 157  157  };
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX