Skip to contentSkip to conversation

md/raid5: Using conf->max_degraded rather than 2 to determine whether there is excess compute-disks for raid4/5/6.

PATCH Applied majianpeng 2 participants 2 messages Oct 27, 2012 – Oct 28, 2012 MD RAID

lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 5/5 md/raid5: Using conf->max_degraded rather than 2 to determine whether there is excess compute-disks for raid4/5/6.

In func analyse_stripe, about judging how many want-computer disks,it used 2.But for raid4/5, it is at most is one.So using conf->max_degraded to replace.

---
 drivers/md/raid5.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid5.c +1 -1
index 684ca76..930dee0 100644
@@ -3285,7 +3285,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
 			s->uptodate++;
 		if (test_bit(R5_Wantcompute, &dev->flags)) {
 			s->compute++;
-			BUG_ON(s->compute > 2);
+			BUG_ON(s->compute > conf->max_degraded);
 		}
 
 		if (test_bit(R5_Wantfill, &dev->flags))
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 14 lines · On Sat, 27 Oct 2012 10:28:25 +0800 majianpeng <[email protected]> wrote:

In func analyse_stripe, about judging how many want-computer disks,it used 2.But for raid4/5, it is at most is one.So using conf->max_degraded to replace.

---
 drivers/md/raid5.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid5.c +0 -0
index 684ca76..930dee0 100644

drivers/md/raid5.c static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s) · line 3291

Quoted 8 lines
drivers/md/raid5.c +1 -1
@@ -3285,7 +3285,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
 			s->uptodate++;
 		if (test_bit(R5_Wantcompute, &dev->flags)) {
 			s->compute++;
-			BUG_ON(s->compute > 2);
+			BUG_ON(s->compute > conf->max_degraded);
 		}
 
 		if (test_bit(R5_Wantfill, &dev->flags))

If I were to bother changing that code at all, I'd just remove the BUG_ON. But I won't bother.

NeilBrown