]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid1: Don't use next_resync to determine how far resync has progressed
authorNeilBrown <neilb@suse.de>
Wed, 10 Sep 2014 05:56:57 +0000 (15:56 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 22 Sep 2014 01:26:01 +0000 (11:26 +1000)
commitd31c1c7bdc81875c92b62df88405c9008cb47341
tree13ea4c98190fd461cae935a0f5cf16cbc1403380
parent94a13d2d6157e82b94e276fa6b7ffb1a5fb3a4d7
md/raid1: Don't use next_resync to determine how far resync has progressed

next_resync is (approximately) the location for the next resync request.
However it does *not* reliably determine the earliest location
at which resync might be happening.
This is because resync requests can complete out of order, and
we only limit the number of current requests, not the distance
from the earliest pending request to the latest.

mddev->curr_resync_completed is a reliable indicator of the earliest
position at which resync could be happening.   It is updated less
frequently, but is actually reliable which is more important.

So use it to determine if a write request is before the region
being resynced and so safe from conflict.

This error can allow resync IO to interfere with normal IO which
could lead to data corruption. Hence: stable.

Fixes: e392bfc1d3ad94b1774445ed8d2d5cc893c0d378
cc: stable@vger.kernel.org (v3.13+)
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c