summaryrefslogtreecommitdiffstats
path: root/module/zfs/metaslab.c
diff options
context:
space:
mode:
authorTim Chase <[email protected]>2015-07-03 09:24:24 -0500
committerBrian Behlendorf <[email protected]>2015-07-06 09:36:13 -0700
commit1cd777340bb2feaedbbdb48cab27ce5ffa14c353 (patch)
tree7d1120db7df854760680e9504f63e76766b6bdaa /module/zfs/metaslab.c
parente16b3fcc610fab2dcf3381486b2640dc2a2213cb (diff)
Prevent reclaim in metaslab preload threads
Reclaim during metaslab preloading can cause deadlocks involving znode z_lock and ARC buffer header ht_lock. Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #3532.
Diffstat (limited to 'module/zfs/metaslab.c')
-rw-r--r--module/zfs/metaslab.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c
index d6ee81c85..5544859b6 100644
--- a/module/zfs/metaslab.c
+++ b/module/zfs/metaslab.c
@@ -1579,6 +1579,7 @@ metaslab_preload(void *arg)
{
metaslab_t *msp = arg;
spa_t *spa = msp->ms_group->mg_vd->vdev_spa;
+ fstrans_cookie_t cookie = spl_fstrans_mark();
ASSERT(!MUTEX_HELD(&msp->ms_group->mg_lock));
@@ -1592,6 +1593,7 @@ metaslab_preload(void *arg)
*/
msp->ms_access_txg = spa_syncing_txg(spa) + metaslab_unload_delay + 1;
mutex_exit(&msp->ms_lock);
+ spl_fstrans_unmark(cookie);
}
static void