Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] md: fix BUG when raid10 rebuilds without enough drives

This shouldn't be a BUG. We should cope.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

NeilBrown and committed by
Linus Torvalds
87fc767b 6d508242

+7 -1
+7 -1
drivers/md/raid10.c
··· 1474 1474 } 1475 1475 } 1476 1476 if (j == conf->copies) { 1477 - BUG(); 1477 + /* Cannot recover, so abort the recovery */ 1478 + put_buf(r10_bio); 1479 + r10_bio = rb2; 1480 + if (!test_and_set_bit(MD_RECOVERY_ERR, &mddev->recovery)) 1481 + printk(KERN_INFO "raid10: %s: insufficient working devices for recovery.\n", 1482 + mdname(mddev)); 1483 + break; 1478 1484 } 1479 1485 } 1480 1486 if (biolist == NULL) {