Get event notification working in multipath. --- diff/drivers/md/dm-mpath.c 2004-01-16 16:40:21.000000000 +0000 +++ source/drivers/md/dm-mpath.c 2004-01-16 18:22:25.000000000 +0000 @@ -64,7 +64,7 @@ struct bio_list test_ios; unsigned test_interval; - atomic_t trigger_event; + unsigned trigger_event; }; static struct path *alloc_path(void) @@ -197,6 +197,7 @@ atomic_inc(&path->fail_total); list_move(&path->list, &path->pg->invalid_paths); path->pg->ps->type->set_path_state(path->pg->ps, path, 0); + path->pg->m->trigger_event = 1; } static void __recover_path(struct path *path) @@ -208,6 +209,7 @@ list_move(&path->list, &path->pg->valid_paths); path->pg->ps->type->set_path_state(path->pg->ps, path, 1); path->has_failed = 0; + path->pg->m->trigger_event = 1; } static int test_endio(struct bio *bio, unsigned int done, int error) @@ -294,6 +296,7 @@ /* Multipathd does this every time it runs, returns a sleep duration hint */ static jiffy_t do_work(void) { + unsigned long flags; struct multipath *m; spin_lock(&_mpath_lock); @@ -302,8 +305,12 @@ iterate_paths(m, test_path); submit_ios(bio_list_get(&m->test_ios)); - if (atomic_dec_and_test(&m->trigger_event)) + spin_lock_irqsave(&m->path_lock, flags); + if (m->trigger_event) { dm_table_event(m->ti->table); + m->trigger_event = 0; + } + spin_unlock_irqrestore(&m->path_lock, flags); } spin_unlock(&_mpath_lock);