]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5: deadlock between retry_aligned_read with barrier io
authorhui jiao <simonjiaoh@gmail.com>
Thu, 5 Jun 2014 03:34:24 +0000 (11:34 +0800)
committerNeilBrown <neilb@suse.de>
Thu, 5 Jun 2014 07:18:19 +0000 (17:18 +1000)
commitab612f67764932061066768949de1b32dbfe108e
tree4f235e9eacd5a86110b70c39fa21673bb2916946
parent8cf1c4c740f876049f14c43835655409260ba363
md/raid5: deadlock between retry_aligned_read with barrier io

A chunk aligned read increases counter active_aligned_reads and
decreases it after sub-device handle it successfully. But when a read
error occurs,  the read redispatched by raid5d, and the
active_aligned_reads will not be decreased until we can grab a stripe
head in retry_aligned_read. Now suppose, a barrier io comes, set
conf->quiesce to 2, and wait until both active_stripes and
active_aligned_reads are zero. The retried chunk aligned read gets
stuck at get_active_stripe waiting until conf->quiesce becomes 0.
Retry_aligned_read and barrier io are waiting each other now.
One possible solution is that we ignore conf->quiesce, let the retried
aligned read finish. I reproduced this deadlock and test this patch on
centos6.0

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