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/dnode.h
          +++ new/usr/src/uts/common/fs/zfs/sys/dnode.h
↓ 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   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
       24 + * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
  24   25   */
  25   26  
  26   27  #ifndef _SYS_DNODE_H
  27   28  #define _SYS_DNODE_H
  28   29  
  29   30  #include <sys/zfs_context.h>
  30   31  #include <sys/avl.h>
  31   32  #include <sys/spa.h>
  32   33  #include <sys/txg.h>
  33   34  #include <sys/zio.h>
↓ open down ↓ 214 lines elided ↑ open up ↑
 248  249   * iterating descendent dbufs in dnode_move(). Handles are not allocated
 249  250   * individually, but as an array of child dnodes in dnode_hold_impl().
 250  251   */
 251  252  typedef struct dnode_handle {
 252  253          /* Protects dnh_dnode from modification by dnode_move(). */
 253  254          zrlock_t dnh_zrlock;
 254  255          dnode_t *dnh_dnode;
 255  256  } dnode_handle_t;
 256  257  
 257  258  typedef struct dnode_children {
      259 +        dmu_buf_user_t dnc_dbu;         /* User evict data */
 258  260          size_t dnc_count;               /* number of children */
 259  261          dnode_handle_t dnc_children[];  /* sized dynamically */
 260  262  } dnode_children_t;
 261  263  
 262  264  typedef struct free_range {
 263  265          avl_node_t fr_node;
 264  266          uint64_t fr_blkid;
 265  267          uint64_t fr_nblks;
 266  268  } free_range_t;
 267  269  
 268      -dnode_t *dnode_special_open(struct objset *dd, dnode_phys_t *dnp,
      270 +void dnode_special_open(struct objset *dd, dnode_phys_t *dnp,
 269  271      uint64_t object, dnode_handle_t *dnh);
 270  272  void dnode_special_close(dnode_handle_t *dnh);
 271  273  
 272  274  void dnode_setbonuslen(dnode_t *dn, int newsize, dmu_tx_t *tx);
 273  275  void dnode_setbonus_type(dnode_t *dn, dmu_object_type_t, dmu_tx_t *tx);
 274  276  void dnode_rm_spill(dnode_t *dn, dmu_tx_t *tx);
 275  277  
 276  278  int dnode_hold(struct objset *dd, uint64_t object,
 277  279      void *ref, dnode_t **dnp);
 278  280  int dnode_hold_impl(struct objset *dd, uint64_t object, int flag,
↓ open down ↓ 62 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX