summaryrefslogtreecommitdiffstats
path: root/super-ddf.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-05-21 05:27:54 +0200
committerNeilBrown <neilb@suse.de>2014-05-21 05:27:54 +0200
commitde9107744bff1d59103858db06b2ba1811cb683f (patch)
tree3c6c2ea48ce71f617b32e63d5338ec7309632974 /super-ddf.c
parentDDF: remove old comment about looking for spares. (diff)
downloadmdadm-de9107744bff1d59103858db06b2ba1811cb683f.tar.xz
mdadm-de9107744bff1d59103858db06b2ba1811cb683f.zip
DDF: ensure dl->devname is freed when processing a 'delete device' update.
As this code runs in 'monitor' it cannot just free memory, it must add it to a list for 'manager' to free. Fortunate update->space_list exists for just this purpose. dl->devname might be small, so put it in update->space and put dl in update->space_list. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/super-ddf.c b/super-ddf.c
index 0c714225..607f1ea1 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -4597,10 +4597,10 @@ static void ddf_process_phys_update(struct supertype *st,
if (dl->pdnum == (signed)ent) {
close(dl->fd);
dl->fd = -1;
- /* FIXME this doesn't free
- * dl->devname */
- update->space = dl;
*dlp = dl->next;
+ update->space = dl->devname;
+ *(void**)dl = update->space_list;
+ update->space_list = (void**)dl;
break;
}
}