summaryrefslogtreecommitdiffstats
path: root/super-intel.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-08-09 20:28:24 -0700
committerDan Williams <dan.j.williams@intel.com>2008-08-11 01:16:24 -0700
commit19859edc2d484a0fc05befa924a57cf576ab65bd (patch)
tree292bbd9135c1cfe2cb9ecb5d155228a39eca8ed4 /super-intel.c
parentd23fe9472d47e136a56fec17d072dab41e88e505 (diff)
downloadmdadm-19859edc2d484a0fc05befa924a57cf576ab65bd.tar.gz
mdadm-19859edc2d484a0fc05befa924a57cf576ab65bd.tar.xz
mdadm-19859edc2d484a0fc05befa924a57cf576ab65bd.zip
imsm: ensure 'usable' remains clear until the disk is in_sync
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/super-intel.c b/super-intel.c
index 632ddd9..b8beb8e 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -2203,6 +2203,12 @@ static void imsm_set_disk(struct active_array *a, int n, int state)
new_failure = 1;
super->updates_pending++;
}
+ /* check if in_sync */
+ if ((state & DS_INSYNC) && !(status & USABLE_DISK)) {
+ status |= USABLE_DISK;
+ disk->status = __cpu_to_le32(status);
+ super->updates_pending++;
+ }
/* the number of failures have changed, count up 'failed' to determine
* degraded / failed status
@@ -2511,7 +2517,7 @@ static void imsm_process_update(struct supertype *st,
disk = &dl->disk;
status = __le32_to_cpu(disk->status);
status |= CONFIGURED_DISK;
- status &= ~SPARE_DISK;
+ status &= ~(SPARE_DISK | USABLE_DISK);
disk->status = __cpu_to_le32(status);
/* count arrays using the victim in the metadata */