]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: FIX: not all disks are released in free_imsm_disks()
authorAdam Kwolek <adam.kwolek@intel.com>
Fri, 28 Jan 2011 13:37:51 +0000 (14:37 +0100)
committerNeilBrown <neilb@suse.de>
Mon, 31 Jan 2011 00:06:42 +0000 (11:06 +1100)
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>
super-intel.c

index cc471991dc9a37c75a03213cb66a4ee7f241b87f..f578057d9842b297572bacd6ab11c8ef6cfc4cdc 100644 (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;