From: NeilBrown Date: Tue, 26 May 2015 22:43:45 +0000 (+1000) Subject: md/raid5: close race between STRIPE_BIT_DELAY and batching. X-Git-Tag: omap-for-v4.2/wakeirq-drivers-v2^2~2^2~44^2~8 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0852df543e5aa7db34c1ad26d053782bcbf48f1;p=pandora-kernel.git md/raid5: close race between STRIPE_BIT_DELAY and batching. When we add a write to a stripe we need to make sure the bitmap bit is set. While doing that the stripe is not locked so it could be added to a batch after which further changes to STRIPE_BIT_DELAY and ->bm_seq are ineffective. So we need to hold off adding to a stripe until bitmap_startwrite has completed at least once, and we need to avoid further changes to STRIPE_BIT_DELAY once the stripe has been added to a batch. If a bitmap_startwrite() completes after the stripe was added to a batch, it will not have set the bit, only incremented a counter, so no extra delay of the stripe is needed. Reported-by: Shaohua Li Signed-off-by: NeilBrown --- Reading git-diff-tree failed