Print this page
5056 ZFS deadlock on db_mtx and dn_holds
Reviewed by: Will Andrews <willa@spectralogic.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sys/dsl_dir.h
          +++ new/usr/src/uts/common/fs/zfs/sys/dsl_dir.h
↓ 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) 2014, Joyent, Inc. All rights reserved.
       25 + * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
  25   26   */
  26   27  
  27   28  #ifndef _SYS_DSL_DIR_H
  28   29  #define _SYS_DSL_DIR_H
  29   30  
  30   31  #include <sys/dmu.h>
  31   32  #include <sys/dsl_pool.h>
  32   33  #include <sys/dsl_synctask.h>
  33   34  #include <sys/refcount.h>
  34   35  #include <sys/zfs_context.h>
↓ open down ↓ 42 lines elided ↑ open up ↑
  77   78          uint64_t dd_reserved;
  78   79          uint64_t dd_props_zapobj;
  79   80          uint64_t dd_deleg_zapobj; /* dataset delegation permissions */
  80   81          uint64_t dd_flags;
  81   82          uint64_t dd_used_breakdown[DD_USED_NUM];
  82   83          uint64_t dd_clones; /* dsl_dir objects */
  83   84          uint64_t dd_pad[13]; /* pad out to 256 bytes for good measure */
  84   85  } dsl_dir_phys_t;
  85   86  
  86   87  struct dsl_dir {
       88 +        dmu_buf_user_t dd_dbu;
       89 +
  87   90          /* These are immutable; no lock needed: */
  88   91          uint64_t dd_object;
  89   92          dsl_pool_t *dd_pool;
  90   93  
  91   94          /* Stable until user eviction; no lock needed: */
  92   95          dmu_buf_t *dd_dbuf;
  93   96  
  94   97          /* protected by lock on pool's dp_dirty_dirs list */
  95   98          txg_node_t dd_dirty_link;
  96   99  
↓ open down ↓ 15 lines elided ↑ open up ↑
 112  115          char dd_myname[MAXNAMELEN];
 113  116  };
 114  117  
 115  118  inline dsl_dir_phys_t *
 116  119  dsl_dir_phys(dsl_dir_t *dd)
 117  120  {
 118  121          return (dd->dd_dbuf->db_data);
 119  122  }
 120  123  
 121  124  void dsl_dir_rele(dsl_dir_t *dd, void *tag);
      125 +void dsl_dir_async_rele(dsl_dir_t *dd, void *tag);
 122  126  int dsl_dir_hold(dsl_pool_t *dp, const char *name, void *tag,
 123  127      dsl_dir_t **, const char **tail);
 124  128  int dsl_dir_hold_obj(dsl_pool_t *dp, uint64_t ddobj,
 125  129      const char *tail, void *tag, dsl_dir_t **);
 126  130  void dsl_dir_name(dsl_dir_t *dd, char *buf);
 127  131  int dsl_dir_namelen(dsl_dir_t *dd);
 128  132  uint64_t dsl_dir_create_sync(dsl_pool_t *dp, dsl_dir_t *pds,
 129  133      const char *name, dmu_tx_t *tx);
 130  134  void dsl_dir_stats(dsl_dir_t *dd, nvlist_t *nv);
 131  135  uint64_t dsl_dir_space_available(dsl_dir_t *dd,
↓ open down ↓ 59 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX