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/sa_impl.h
          +++ new/usr/src/uts/common/fs/zfs/sys/sa_impl.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) 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright (c) 2013 by Delphix. All rights reserved.
       24 + * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
  24   25   */
  25   26  
  26   27  #ifndef _SYS_SA_IMPL_H
  27   28  #define _SYS_SA_IMPL_H
  28   29  
  29   30  #include <sys/dmu.h>
  30   31  #include <sys/refcount.h>
  31   32  #include <sys/list.h>
  32   33  
  33   34  /*
↓ open down ↓ 169 lines elided ↑ open up ↑
 203  204          SA_REMOVE
 204  205  } sa_data_op_t;
 205  206  
 206  207  /*
 207  208   * Opaque handle used for most sa functions
 208  209   *
 209  210   * This needs to be kept as small as possible.
 210  211   */
 211  212  
 212  213  struct sa_handle {
      214 +        dmu_buf_user_t  sa_dbu;
 213  215          kmutex_t        sa_lock;
 214  216          dmu_buf_t       *sa_bonus;
 215  217          dmu_buf_t       *sa_spill;
 216  218          objset_t        *sa_os;
 217      -        void            *sa_userp;
      219 +        void            *sa_userp;
 218  220          sa_idx_tab_t    *sa_bonus_tab;   /* idx of bonus */
 219  221          sa_idx_tab_t    *sa_spill_tab; /* only present if spill activated */
 220  222  };
 221  223  
 222  224  #define SA_GET_DB(hdl, type)    \
 223  225          (dmu_buf_impl_t *)((type == SA_BONUS) ? hdl->sa_bonus : hdl->sa_spill)
 224  226  
 225  227  #define SA_GET_HDR(hdl, type) \
 226  228          ((sa_hdr_phys_t *)((dmu_buf_impl_t *)(SA_GET_DB(hdl, \
 227  229          type))->db.db_data))
↓ open down ↓ 62 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX