]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/0006-md-never-clear-bit-from-the-write-intent-bitmap-when.patch
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / 0006-md-never-clear-bit-from-the-write-intent-bitmap-when.patch
CommitLineData
2cb7cef9
BS
1From d0a4bb492772ce5c4bdfba3744a99ed6f6fb238f Mon Sep 17 00:00:00 2001
2From: NeilBrown <neilb@suse.de>
3Date: Tue, 31 Mar 2009 14:27:02 +1100
4Subject: [PATCH] md: never clear bit from the write-intent bitmap when the array is degraded.
5
6It is safe to clear a bit from the write-intent bitmap for a raid1
7if we know the data has been written to all devices, which is
8what the current test does.
9
10But it is not always safe to update the 'events_cleared' counter in
11that case. This is because one request could complete successfully
12after some other request has partially failed.
13
14So simply disable the clearing and updating of events_cleared whenever
15the array is degraded. This might end up not clearing some bits that
16could safely be cleared, but it is safest approach.
17
18Note that the bug fixed here did not risk corrupting data by letting
19the array get out-of-sync. Rather it meant that when a device is
20removed and re-added to the array, it might incorrectly require a full
21recovery rather than just recovering based on the bitmap.
22
23Signed-off-by: NeilBrown <neilb@suse.de>
24---
25 drivers/md/bitmap.c | 3 +++
26 1 file changed, 3 insertions(+)
27
28--- a/drivers/md/bitmap.c
29+++ b/drivers/md/bitmap.c
30@@ -1307,6 +1307,9 @@ void bitmap_endwrite(struct bitmap *bitm
31 PRINTK(KERN_DEBUG "dec write-behind count %d/%d\n",
32 atomic_read(&bitmap->behind_writes), bitmap->max_write_behind);
33 }
34+ if (bitmap->mddev->degraded)
35+ /* Never clear bits or update events_cleared when degraded */
36+ success = 0;
37
38 while (sectors) {
39 int blocks;