aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-06-09 20:43:59 +0200
committerJens Axboe <jaxboe@fusionio.com>2011-06-09 20:43:59 +0200
commitfdd514e16bb2531c0c61ae8a1f87740ce217f630 (patch)
tree5d7b6d4f9112b0b6f93f7ce939045fb634abc3fa /block/cfq-iosched.c
parentc3af54afbac3675337cedf326b7b127ffa7f7327 (diff)
downloadkernel_samsung_smdk4412-fdd514e16bb2531c0c61ae8a1f87740ce217f630.zip
kernel_samsung_smdk4412-fdd514e16bb2531c0c61ae8a1f87740ce217f630.tar.gz
kernel_samsung_smdk4412-fdd514e16bb2531c0c61ae8a1f87740ce217f630.tar.bz2
block: make disk_block_events() properly wait for work cancellation
disk_block_events() should guarantee that the event work is not in flight on return and once blocked it shouldn't issue further cancellations. Because there was no synchronization between the first blocker doing cancel_delayed_work_sync() and the following blockers, the following blockers could finish before cancellation was complete, which broke both guarantees - event work could be in flight and cancellation could happen after return. This bug triggered WARN_ON_ONCE() in disk_clear_events() reported in bug#34662. https://bugzilla.kernel.org/show_bug.cgi?id=34662 Fix it by adding an outer mutex which protects both block count manipulation and work cancellation. -v2: Use outer mutex instead of bit waitqueue per Linus. Signed-off-by: Tejun Heo <tj@kernel.org> Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com> Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com> Reported-by: Borislav Petkov <bp@alien8.de> Reported-by: Meelis Roos <mroos@linux.ee> Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jens Axboe <axboe@kernel.dk> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/cfq-iosched.c')
0 files changed, 0 insertions, 0 deletions