summaryrefslogtreecommitdiff
path: root/Incremental.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 /Incremental.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 'Incremental.c')
-rw-r--r--Incremental.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Incremental.c b/Incremental.c
index a4ac1b58..944ed661 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -1411,6 +1411,12 @@ static int Incremental_container(struct supertype *st, char *devname,
if (map_lock(&map))
fprintf(stderr, Name ": failed to get exclusive lock on "
"mapfile\n");
+ /* do not assemble arrays that might have bad blocks */
+ if (list->array.state & (1<<MD_SB_BBM_ERRORS)) {
+ fprintf(stderr, Name ": BBM log found in metadata. "
+ "Cannot activate array(s).\n");
+ list = NULL;
+ }
for (ra = list ; ra ; ra = ra->next) {
int mdfd;