提交 87fc767b 编写于 作者: N NeilBrown 提交者: Linus Torvalds

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

This shouldn't be a BUG.  We should cope.
Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 6d508242
...@@ -1474,7 +1474,13 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i ...@@ -1474,7 +1474,13 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
} }
} }
if (j == conf->copies) { if (j == conf->copies) {
BUG(); /* Cannot recover, so abort the recovery */
put_buf(r10_bio);
r10_bio = rb2;
if (!test_and_set_bit(MD_RECOVERY_ERR, &mddev->recovery))
printk(KERN_INFO "raid10: %s: insufficient working devices for recovery.\n",
mdname(mddev));
break;
} }
} }
if (biolist == NULL) { if (biolist == NULL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册