]> granicus.if.org Git - zfs/commitdiff
Prevent reclaim in the traverse prefetch thread
authorTim Chase <tim@chase2k.com>
Thu, 3 Sep 2015 12:13:15 +0000 (07:13 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 4 Sep 2015 15:43:28 +0000 (08:43 -0700)
Reclaim in the traverse prefetch thread, which is run on the system
taskq, can overrun the stack.

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

module/zfs/dmu_traverse.c

index 44b23280d4101588e3d32792e21d6ff95e677a9f..12d099bfd414fb546f4c0364dc637d8724168ffe 100644 (file)
@@ -476,6 +476,7 @@ traverse_prefetch_thread(void *arg)
        traverse_data_t *td_main = arg;
        traverse_data_t td = *td_main;
        zbookmark_phys_t czb;
+       fstrans_cookie_t cookie = spl_fstrans_mark();
 
        td.td_func = traverse_prefetcher;
        td.td_arg = td_main->td_pfd;
@@ -489,6 +490,7 @@ traverse_prefetch_thread(void *arg)
        td_main->td_pfd->pd_exited = B_TRUE;
        cv_broadcast(&td_main->td_pfd->pd_cv);
        mutex_exit(&td_main->td_pfd->pd_mtx);
+       spl_fstrans_unmark(cookie);
 }
 
 /*