diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-04-12 09:58:28 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-04-12 09:58:28 +0200 |
commit | 506ffd1e0bd08cc74f5177d4f4db7c66d7724f6a (patch) | |
tree | 86972ba933cd8b81e32c09ceda431955bb653eba /mapfile.c | |
parent | imsm: add the ddf field (diff) | |
download | mdadm-506ffd1e0bd08cc74f5177d4f4db7c66d7724f6a.tar.xz mdadm-506ffd1e0bd08cc74f5177d4f4db7c66d7724f6a.zip |
RebuildMap: handle missing disks
When rebuilding the map file tolerate missing/offline disks, otherwise
we will segfault on the NULL return from sysfs_read.
Reported-by: Jacek Danecki <jacek.danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'mapfile.c')
-rw-r--r-- | mapfile.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -294,9 +294,12 @@ void RebuildMap(void) int mdp = get_mdp_major(); for (md = mdstat ; md ; md = md->next) { - struct mdinfo *sra = sysfs_read(-1, md->devnum, GET_DEVS); + struct mdinfo *sra = sysfs_read(-1, md->devnum, GET_DEVS|SKIP_GONE_DEVS); struct mdinfo *sd; + if (!sra) + continue; + for (sd = sra->devs ; sd ; sd = sd->next) { char dn[30]; int dfd; |