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>


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  24  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.

  25  */
  26 
  27 #ifndef _SYS_SPA_IMPL_H
  28 #define _SYS_SPA_IMPL_H
  29 
  30 #include <sys/spa.h>
  31 #include <sys/vdev.h>
  32 #include <sys/metaslab.h>
  33 #include <sys/dmu.h>
  34 #include <sys/dsl_pool.h>
  35 #include <sys/uberblock_impl.h>
  36 #include <sys/zfs_context.h>
  37 #include <sys/avl.h>
  38 #include <sys/refcount.h>
  39 #include <sys/bplist.h>
  40 #include <sys/bpobj.h>
  41 #include <sys/zfeature.h>
  42 #include <zfeature_common.h>
  43 
  44 #ifdef  __cplusplus


 127         nvlist_t        *spa_load_info;         /* info and errors from load */
 128         uint64_t        spa_config_txg;         /* txg of last config change */
 129         int             spa_sync_pass;          /* iterate-to-convergence */
 130         pool_state_t    spa_state;              /* pool state */
 131         int             spa_inject_ref;         /* injection references */
 132         uint8_t         spa_sync_on;            /* sync threads are running */
 133         spa_load_state_t spa_load_state;        /* current load operation */
 134         uint64_t        spa_import_flags;       /* import specific flags */
 135         spa_taskqs_t    spa_zio_taskq[ZIO_TYPES][ZIO_TASKQ_TYPES];
 136         dsl_pool_t      *spa_dsl_pool;
 137         boolean_t       spa_is_initializing;    /* true while opening pool */
 138         metaslab_class_t *spa_normal_class;     /* normal data class */
 139         metaslab_class_t *spa_log_class;        /* intent log data class */
 140         uint64_t        spa_first_txg;          /* first txg after spa_open() */
 141         uint64_t        spa_final_txg;          /* txg of export/destroy */
 142         uint64_t        spa_freeze_txg;         /* freeze pool at this txg */
 143         uint64_t        spa_load_max_txg;       /* best initial ub_txg */
 144         uint64_t        spa_claim_max_txg;      /* highest claimed birth txg */
 145         timespec_t      spa_loaded_ts;          /* 1st successful open time */
 146         objset_t        *spa_meta_objset;       /* copy of dp->dp_meta_objset */



 147         txg_list_t      spa_vdev_txg_list;      /* per-txg dirty vdev list */
 148         vdev_t          *spa_root_vdev;         /* top-level vdev container */
 149         uint64_t        spa_config_guid;        /* config pool guid */
 150         uint64_t        spa_load_guid;          /* spa_load initialized guid */
 151         uint64_t        spa_last_synced_guid;   /* last synced guid */
 152         list_t          spa_config_dirty_list;  /* vdevs with dirty config */
 153         list_t          spa_state_dirty_list;   /* vdevs with dirty state */
 154         spa_aux_vdev_t  spa_spares;             /* hot spares */
 155         spa_aux_vdev_t  spa_l2cache;            /* L2ARC cache devices */
 156         nvlist_t        *spa_label_features;    /* Features for reading MOS */
 157         uint64_t        spa_config_object;      /* MOS object for pool config */
 158         uint64_t        spa_config_generation;  /* config generation number */
 159         uint64_t        spa_syncing_txg;        /* txg currently syncing */
 160         bpobj_t         spa_deferred_bpobj;     /* deferred-free bplist */
 161         bplist_t        spa_free_bplist[TXG_SIZE]; /* bplist of stuff to free */
 162         uberblock_t     spa_ubsync;             /* last synced uberblock */
 163         uberblock_t     spa_uberblock;          /* current uberblock */
 164         boolean_t       spa_extreme_rewind;     /* rewind past deferred frees */
 165         uint64_t        spa_last_io;            /* lbolt of last non-scan I/O */
 166         kmutex_t        spa_scrub_lock;         /* resilver/scrub lock */




   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  24  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  25  * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
  26  */
  27 
  28 #ifndef _SYS_SPA_IMPL_H
  29 #define _SYS_SPA_IMPL_H
  30 
  31 #include <sys/spa.h>
  32 #include <sys/vdev.h>
  33 #include <sys/metaslab.h>
  34 #include <sys/dmu.h>
  35 #include <sys/dsl_pool.h>
  36 #include <sys/uberblock_impl.h>
  37 #include <sys/zfs_context.h>
  38 #include <sys/avl.h>
  39 #include <sys/refcount.h>
  40 #include <sys/bplist.h>
  41 #include <sys/bpobj.h>
  42 #include <sys/zfeature.h>
  43 #include <zfeature_common.h>
  44 
  45 #ifdef  __cplusplus


 128         nvlist_t        *spa_load_info;         /* info and errors from load */
 129         uint64_t        spa_config_txg;         /* txg of last config change */
 130         int             spa_sync_pass;          /* iterate-to-convergence */
 131         pool_state_t    spa_state;              /* pool state */
 132         int             spa_inject_ref;         /* injection references */
 133         uint8_t         spa_sync_on;            /* sync threads are running */
 134         spa_load_state_t spa_load_state;        /* current load operation */
 135         uint64_t        spa_import_flags;       /* import specific flags */
 136         spa_taskqs_t    spa_zio_taskq[ZIO_TYPES][ZIO_TASKQ_TYPES];
 137         dsl_pool_t      *spa_dsl_pool;
 138         boolean_t       spa_is_initializing;    /* true while opening pool */
 139         metaslab_class_t *spa_normal_class;     /* normal data class */
 140         metaslab_class_t *spa_log_class;        /* intent log data class */
 141         uint64_t        spa_first_txg;          /* first txg after spa_open() */
 142         uint64_t        spa_final_txg;          /* txg of export/destroy */
 143         uint64_t        spa_freeze_txg;         /* freeze pool at this txg */
 144         uint64_t        spa_load_max_txg;       /* best initial ub_txg */
 145         uint64_t        spa_claim_max_txg;      /* highest claimed birth txg */
 146         timespec_t      spa_loaded_ts;          /* 1st successful open time */
 147         objset_t        *spa_meta_objset;       /* copy of dp->dp_meta_objset */
 148         kmutex_t        spa_evicting_os_lock;   /* Evicting objset list lock */
 149         list_t          spa_evicting_os_list;   /* Objsets being evicted. */
 150         kcondvar_t      spa_evicting_os_cv;     /* Objset Eviction Completion */
 151         txg_list_t      spa_vdev_txg_list;      /* per-txg dirty vdev list */
 152         vdev_t          *spa_root_vdev;         /* top-level vdev container */
 153         uint64_t        spa_config_guid;        /* config pool guid */
 154         uint64_t        spa_load_guid;          /* spa_load initialized guid */
 155         uint64_t        spa_last_synced_guid;   /* last synced guid */
 156         list_t          spa_config_dirty_list;  /* vdevs with dirty config */
 157         list_t          spa_state_dirty_list;   /* vdevs with dirty state */
 158         spa_aux_vdev_t  spa_spares;             /* hot spares */
 159         spa_aux_vdev_t  spa_l2cache;            /* L2ARC cache devices */
 160         nvlist_t        *spa_label_features;    /* Features for reading MOS */
 161         uint64_t        spa_config_object;      /* MOS object for pool config */
 162         uint64_t        spa_config_generation;  /* config generation number */
 163         uint64_t        spa_syncing_txg;        /* txg currently syncing */
 164         bpobj_t         spa_deferred_bpobj;     /* deferred-free bplist */
 165         bplist_t        spa_free_bplist[TXG_SIZE]; /* bplist of stuff to free */
 166         uberblock_t     spa_ubsync;             /* last synced uberblock */
 167         uberblock_t     spa_uberblock;          /* current uberblock */
 168         boolean_t       spa_extreme_rewind;     /* rewind past deferred frees */
 169         uint64_t        spa_last_io;            /* lbolt of last non-scan I/O */
 170         kmutex_t        spa_scrub_lock;         /* resilver/scrub lock */