From 40749aa7a6318e5588d4be1c40165e8d0ef6c44f Mon Sep 17 00:00:00 2001 From: Chunwei Chen Date: Mon, 16 Mar 2015 23:54:57 -0700 Subject: [PATCH] Use MUTEX_FSTRANS on l2arc_buflist_mtx Use MUTEX_FSTRANS on l2arc_buflist_mtx to prevent the following deadlock scenario: 1. arc_release() -> hash_lock -> l2arc_buflist_mtx 2. l2arc_write_buffers() -> l2arc_buflist_mtx -> (direct reclaim) -> arc_buf_remove_ref() -> hash_lock Signed-off-by: Chunwei Chen Signed-off-by: Brian Behlendorf Signed-off-by: Signed-off-by: Tim Chase Issue #3160 --- module/zfs/arc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 9a81b4c59..6c625c108 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -5530,7 +5530,7 @@ l2arc_init(void) mutex_init(&l2arc_feed_thr_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&l2arc_feed_thr_cv, NULL, CV_DEFAULT, NULL); mutex_init(&l2arc_dev_mtx, NULL, MUTEX_DEFAULT, NULL); - mutex_init(&l2arc_buflist_mtx, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&l2arc_buflist_mtx, NULL, MUTEX_FSTRANS, NULL); mutex_init(&l2arc_free_on_write_mtx, NULL, MUTEX_DEFAULT, NULL); l2arc_dev_list = &L2ARC_dev_list;