summaryrefslogtreecommitdiff
path: root/Assemble.c
diff options
context:
space:
mode:
authorKrzysztof Wojcik <krzysztof.wojcik@intel.com>2010-12-16 14:34:54 +0100
committerNeilBrown <neilb@suse.de>2010-12-26 21:41:57 +1100
commita06d022db41ed624125e343f9a5de278c5d32ae3 (patch)
treecfaf7698ea1abcb21ec20c8a7df67fbab882e928 /Assemble.c
parente53763098186f2a7708feb2b9b779c5b7cdb9a71 (diff)
FIX: Bad block verification during assembling array
We need to refuse to assemble an arrays with bad blocks. Initially there was condition in container_content function that returns error value in the case when metadata store information about bad blocks. When the container_content function is called from functions NOT connected with assemble (Kill_subarray, Detail) we get faulty error return value. Patch introduces new flag in array.status - MD_SB_BBM_ERRORS. It is set in container_content when bad blocks are detected and can be checked by container_content caller. Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Assemble.c b/Assemble.c
index ac489e87..5405972e 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -435,6 +435,13 @@ int Assemble(struct supertype *st, char *mddev,
content;
content = content->next) {
+ /* do not assemble arrays that might have bad blocks */
+ if (content->array.state & (1<<MD_SB_BBM_ERRORS)) {
+ fprintf(stderr, Name ": BBM log found in metadata. "
+ "Cannot activate array(s).\n");
+ tmpdev->used = 2;
+ goto loop;
+ }
if (!ident_matches(ident, content, tst,
homehost, update,
report_missmatch ? devname : NULL))