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>
This commit is contained in:
parent
252d23c018
commit
506ffd1e0b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue