md/raid5: don't complete make_request on barrier until writes are scheduled
authorNeilBrown <neilb@suse.de>
Mon, 14 Dec 2009 01:49:50 +0000 (12:49 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 14 Dec 2009 01:51:40 +0000 (12:51 +1100)
commit729a18663a30a9c8076e3adc2b3e4c866974f935
tree14f8e15ffa09d6a583fccdbe2ddf84c7cb8c2246
parenta2826aa92e2e14db372eda01d333267258944033
md/raid5: don't complete make_request on barrier until writes are scheduled

The post-barrier-flush is sent by md as soon as make_request on the
barrier write completes.  For raid5, the data might not be in the
per-device queues yet.  So for barrier requests, wait for any
pre-reading to be done so that the request will be in the per-device
queues.

We use the 'preread_active' count to check that nothing is still in
the preread phase, and delay the decrement of this count until after
write requests have been submitted to the underlying devices.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c