summaryrefslogtreecommitdiffstats
path: root/drivers/md/bitmap.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-07-15 12:56:35 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-15 18:54:51 +0200
commit6a806c510de490318846b53bbfec463d02ca274b (patch)
tree7018abfd9db7856708bc2c578f48c30eab8855b1 /drivers/md/bitmap.c
parent[PATCH] rocket.c: Fix ldisc ref count handling (diff)
downloadlinux-6a806c510de490318846b53bbfec463d02ca274b.tar.xz
linux-6a806c510de490318846b53bbfec463d02ca274b.zip
[PATCH] md/raid1: clear bitmap when fullsync completes
We need to be careful differentiating between a resync of a complete array, in which we can clear the bitmap, and a resync of a degraded array, in which we cannot. This patch cleans all that up. Cc: Paul Clements <paul.clements@steeleye.com> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r--drivers/md/bitmap.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 95980ad6b27b..0c2ed99a3832 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -1345,7 +1345,8 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto
}
}
-int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks)
+int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks,
+ int degraded)
{
bitmap_counter_t *bmc;
int rv;
@@ -1362,8 +1363,10 @@ int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks)
rv = 1;
else if (NEEDED(*bmc)) {
rv = 1;
- *bmc |= RESYNC_MASK;
- *bmc &= ~NEEDED_MASK;
+ if (!degraded) { /* don't set/clear bits if degraded */
+ *bmc |= RESYNC_MASK;
+ *bmc &= ~NEEDED_MASK;
+ }
}
}
spin_unlock_irq(&bitmap->lock);