]> git.baikalelectronics.ru Git - kernel.git/commit
md: never clear bit from the write-intent bitmap when the array is degraded.
authorNeilBrown <neilb@suse.de>
Tue, 31 Mar 2009 03:27:02 +0000 (14:27 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 31 Mar 2009 03:27:02 +0000 (14:27 +1100)
commit6ebf5f33ed27b3632d2f58ffc2b69dbf32bd3258
treea76356c2051e6f225c31989dbf278689554dfcbf
parentee0e900d44f5293cf67ace7f5e9f786feee0832d
md: never clear bit from the write-intent bitmap when the array is degraded.

It is safe to clear a bit from the write-intent bitmap for a raid1
if we know the data has been written to all devices, which is
what the current test does.

But it is not always safe to update the 'events_cleared' counter in
that case.  This is because one request could complete successfully
after some other request has partially failed.

So simply disable the clearing and updating of events_cleared whenever
the array is degraded.  This might end up not clearing some bits that
could safely be cleared, but it is safest approach.

Note that the bug fixed here did not risk corrupting data by letting
the array get out-of-sync.  Rather it meant that when a device is
removed and re-added to the array, it might incorrectly require a full
recovery rather than just recovering based on the bitmap.

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