]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Prevent reclaim in metaslab preload threads
authorTim Chase <tim@chase2k.com>
Fri, 3 Jul 2015 14:24:24 +0000 (09:24 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 6 Jul 2015 16:36:13 +0000 (09:36 -0700)
Reclaim during metaslab preloading can cause deadlocks involving znode
z_lock and ARC buffer header ht_lock.

Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3532.

module/zfs/metaslab.c

index d6ee81c859d0f6e4538a3acd9ae82328e22326e7..5544859b68eff5728a22fdddb3f597b28c32ca4f 100644 (file)
@@ -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