should_wake is just an optimization to avoid waking the thread up when there's already something to do. Don't do this optimization in failure handling code. It is totally pointless to optimize failures. Signed-off-by: Mikulas Patocka --- drivers/md/dm-raid1.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) Index: linux-2.6.31-rc3-devel/drivers/md/dm-raid1.c =================================================================== --- linux-2.6.31-rc3-devel.orig/drivers/md/dm-raid1.c 2009-07-20 20:28:26.000000000 +0200 +++ linux-2.6.31-rc3-devel/drivers/md/dm-raid1.c 2009-07-20 20:28:39.000000000 +0200 @@ -527,7 +527,6 @@ static void write_callback(unsigned long struct bio *bio = (struct bio *) context; struct mirror_set *ms; int uptodate = 0; - int should_wake = 0; unsigned long flags; ms = bio_get_m(bio)->ms; @@ -559,12 +558,9 @@ static void write_callback(unsigned long * the main thread. */ spin_lock_irqsave(&ms->lock, flags); - if (!ms->failures.head) - should_wake = 1; bio_list_add(&ms->failures, bio); spin_unlock_irqrestore(&ms->lock, flags); - if (should_wake) - wakeup_mirrord(ms); + wakeup_mirrord(ms); return; } out: