From 2d7d46afec08e4bcb9596d2892a2f0a404e4c1ac Mon Sep 17 00:00:00 2001 From: Tim Chase Date: Fri, 3 Jul 2015 09:24:24 -0500 Subject: [PATCH] Prevent reclaim in metaslab preload threads Reclaim during metaslab preloading can cause deadlocks involving znode z_lock and ARC buffer header ht_lock. Fixes #3532. --- module/zfs/metaslab.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c index d6ee81c859d0..5544859b68ef 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