diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-01-23 15:45:34 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-01-23 15:45:34 -0700 |
commit | caf8d2317519df27b805919c3878fe3c3acc6923 (patch) | |
tree | e7b036d1c1010ec9ea1868b1ccd456b13602889c /super-intel.c | |
parent | 5615172f1d9daba1d5927758322f7addda803159 (diff) | |
download | mdadm-caf8d2317519df27b805919c3878fe3c3acc6923.tar.gz mdadm-caf8d2317519df27b805919c3878fe3c3acc6923.tar.xz mdadm-caf8d2317519df27b805919c3878fe3c3acc6923.zip |
imsm: fix failed disks are allowed back into the container
Failed disks do not have valid serial numbers which means we will not
pick up the 'failed' status bit from the metadata entry. Check for
dl->index == -2 to prevent failed disks from being incorporated into the
container.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/super-intel.c b/super-intel.c index 0a7c34a..5c9f413 100644 --- a/super-intel.c +++ b/super-intel.c @@ -1195,8 +1195,11 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info) info->component_size = reserved; s = disk->status; info->disk.state = s & CONFIGURED_DISK ? (1 << MD_DISK_ACTIVE) : 0; - info->disk.state |= s & FAILED_DISK ? (1 << MD_DISK_FAULTY) : 0; info->disk.state |= s & SPARE_DISK ? 0 : (1 << MD_DISK_SYNC); + if (s & FAILED_DISK || super->disks->index == -2) { + info->disk.state |= 1 << MD_DISK_FAULTY; + info->disk.raid_disk = -2; + } } /* only call uuid_from_super_imsm when this disk is part of a populated container, |