Messages in this thread Patch in this message | | | Date | Wed, 6 Apr 2011 06:04:23 -0700 | From | Tejun Heo <> | Subject | Re: WARNING: at block/genhd.c:1556 disk_clear_events+0xdc/0xf0() |
| |
I think disk_block_events was a bit too agressive with optimization. Can you please test the following patch and see whether the problem goes away?
Thanks.
diff --git a/block/genhd.c b/block/genhd.c index c91a2da..ae4079a 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1418,18 +1418,15 @@ static void __disk_block_events(struct gendisk *disk, bool sync) { struct disk_events *ev = disk->ev; unsigned long flags; - bool cancel; spin_lock_irqsave(&ev->lock, flags); - cancel = !ev->block++; + ev->block++; spin_unlock_irqrestore(&ev->lock, flags); - if (cancel) { - if (sync) - cancel_delayed_work_sync(&disk->ev->dwork); - else - cancel_delayed_work(&disk->ev->dwork); - } + if (sync) + cancel_delayed_work_sync(&disk->ev->dwork); + else + cancel_delayed_work(&disk->ev->dwork); } static void __disk_unblock_events(struct gendisk *disk, bool check_now)
| |