imsm: FIX: not all disks are released in free_imsm_disks()

Adding spare disks to imsm container fails due to problem with writing
new_dev to sysfs. This problem was caused by not closed handle
(opened exclusively) in Manage.c:803.

Disk handle was not closed by free_imsm().
This is due to not released disk_mgmt_list in free_imsm_disks().

Proper release of imsm metadata allows for spare adding without problems.
Memory leak was fixed also.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-01-28 14:37:51 +01:00 committed by NeilBrown
parent a1e49d6956
commit cb82edca14
1 changed files with 5 additions and 0 deletions

View File

@ -2687,6 +2687,11 @@ static void free_imsm_disks(struct intel_super *super)
super->disks = d->next;
__free_imsm_disk(d);
}
while (super->disk_mgmt_list) {
d = super->disk_mgmt_list;
super->disk_mgmt_list = d->next;
__free_imsm_disk(d);
}
while (super->missing) {
d = super->missing;
super->missing = d->next;