]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid1{,0}: fix deadlock in bitmap_unplug.
authorNeilBrown <neilb@suse.de>
Tue, 27 Nov 2012 01:14:40 +0000 (12:14 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 27 Nov 2012 01:14:40 +0000 (12:14 +1100)
commitb873f8234f8092e7ab28c309f2e7f3014cd0233e
treec36b108b47272d31cbe906cb4267829c02e9c121
parente109b61ed8e9aa4457c8ec841f3a1a5b09cdced7
md/raid1{,0}: fix deadlock in bitmap_unplug.

If the raid1 or raid10 unplug function gets called
from a make_request function (which is very possible) when
there are bios on the current->bio_list list, then it will not
be able to successfully call bitmap_unplug() and it could
need to submit more bios and wait for them to complete.
But they won't complete while current->bio_list is non-empty.

So detect that case and handle the unplugging off to another thread
just like we already do when called from within the scheduler.

RAID1 version of bug was introduced in 3.6, so that part of fix is
suitable for 3.6.y.  RAID10 part won't apply.

Cc: stable@vger.kernel.org
Reported-by: Torsten Kaiser <just.for.lkml@googlemail.com>
Reported-by: Peter Maloney <peter.maloney@brockmann-consult.de>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c
drivers/md/raid10.c