summaryrefslogtreecommitdiff
path: root/super-intel.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 /super-intel.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 'super-intel.c')
-rw-r--r--super-intel.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/super-intel.c b/super-intel.c
index 3fc1c823..adb85b23 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -4520,13 +4520,11 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
struct imsm_super *mpb = super->anchor;
struct mdinfo *rest = NULL;
unsigned int i;
+ int bbm_errors = 0;
- /* do not assemble arrays that might have bad blocks */
- if (imsm_bbm_log_size(super->anchor)) {
- fprintf(stderr, Name ": BBM log found in metadata. "
- "Cannot activate array(s).\n");
- return NULL;
- }
+ /* check for bad blocks */
+ if (imsm_bbm_log_size(super->anchor))
+ bbm_errors = 1;
for (i = 0; i < mpb->num_raid_devs; i++) {
struct imsm_dev *dev;
@@ -4635,6 +4633,10 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
rest = this;
}
+ /* if array has bad blocks, set suitable bit in array status */
+ if (bbm_errors)
+ rest->array.state |= (1<<MD_SB_BBM_ERRORS);
+
return rest;
}