From 1cd777340bb2feaedbbdb48cab27ce5ffa14c353 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. Signed-off-by: Tim Chase Signed-off-by: Brian Behlendorf Closes #3532. --- module/zfs/metaslab.c | 2 ++ 1 file changed, 2 insertions(+) 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