diff options
author | Dan Williams <dan.j.williams@intel.com> | 2010-05-26 13:33:43 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-05-26 13:33:43 -0700 |
commit | 4363fd80bcc9f85ed824228dee5e6350a8d73e18 (patch) | |
tree | 6831570d921c17421acb148e7ff0dad6d0f9fd87 | |
parent | 10013317ce51c6b619f9782b55e9b6b9f536f0a8 (diff) | |
download | mdadm-4363fd80bcc9f85ed824228dee5e6350a8d73e18.tar.gz mdadm-4363fd80bcc9f85ed824228dee5e6350a8d73e18.tar.xz mdadm-4363fd80bcc9f85ed824228dee5e6350a8d73e18.zip |
imsm: robustify recovery-start detection
update_recovery_start() assumed that the out-of-sync disk would always be
marked as IMSM_ORD_REBUILD in the disk_ord_tbl, but the segmentation
fault reported by Andy proves otherwise. This might also be explained by
an interrupted rebuild and the disk has not yet been marked missing.
https://bugzilla.redhat.com/show_bug.cgi?id=592030
Reported-by: Andy Lutomirski <luto@mit.edu>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | super-intel.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c index bdd7a96..dd9699d 100644 --- a/super-intel.c +++ b/super-intel.c @@ -4044,6 +4044,15 @@ static void update_recovery_start(struct imsm_dev *dev, struct mdinfo *array) rebuild = d; } + if (!rebuild) { + /* (?) none of the disks are marked with + * IMSM_ORD_REBUILD, so assume they are missing and the + * disk_ord_tbl was not correctly updated + */ + dprintf("%s: failed to locate out-of-sync disk\n", __func__); + return; + } + units = __le32_to_cpu(dev->vol.curr_migr_unit); rebuild->recovery_start = units * blocks_per_migr_unit(dev); } |