[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH] dm-mpath: Don't call dm_table_event() inside a spinlock



Can't call dm_table_event() while holding a spinlock with interrupts disabled.

--- diff/drivers/md/dm-mpath.c	2004-02-12 14:06:50.000000000 -0600
+++ source/drivers/md/dm-mpath.c	2004-02-12 14:06:32.000000000 -0600
@@ -408,6 +408,7 @@
 	unsigned long flags;
 	struct multipath *m;
 	unsigned interval = 0;
+	int event;
 
 	down(&_mpath_lock);
 	list_for_each_entry (m, &_mpaths, list) {
@@ -416,12 +417,16 @@
 		submit_ios(bio_list_get(&m->test_ios));
 
 		spin_lock_irqsave(&m->lock, flags);
+		event = 0;
 		if (m->trigger_event) {
-			dm_table_event(m->ti->table);
+			event = 1;
 			m->trigger_event = 0;
 		}
 		spin_unlock_irqrestore(&m->lock, flags);
 
+		if (event)
+			dm_table_event(m->ti->table);
+
 		interval = min_not_zero(interval, m->test_interval);
 	}
 	up(&_mpath_lock);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]