summaryrefslogtreecommitdiff
path: root/Incremental.c
diff options
context:
space:
mode:
authorLukasz Dorau <lukasz.dorau@intel.com>2011-10-03 08:55:02 +1100
committerNeilBrown <neilb@suse.de>2011-10-03 08:55:02 +1100
commitcc700db34f6fb565b37f4edf7fe7fe40a5f2745b (patch)
treee66823392910fe75f39af2fcb624ae10d68fced0 /Incremental.c
parente3da7890555d8cfe17fd9ee4f5f04ab64f855919 (diff)
fix: correct unlocking of map file
1. Three missing map_unlock() calls were added. 2. Map file must be unlocked on fork, else child will hold lock. Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r--Incremental.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Incremental.c b/Incremental.c
index 791ad85a..a3e05a7c 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -1469,6 +1469,7 @@ static int Incremental_container(struct supertype *st, char *devname,
"Cannot activate array(s).\n");
/* free container data and exit */
sysfs_free(list);
+ map_unlock(&map);
return 2;
}
@@ -1532,6 +1533,7 @@ static int Incremental_container(struct supertype *st, char *devname,
fprintf(stderr, Name ": array %s/%s is "
"explicitly ignored by mdadm.conf\n",
match->container, match->member);
+ map_unlock(&map);
return 2;
}
if (match)
@@ -1547,6 +1549,7 @@ static int Incremental_container(struct supertype *st, char *devname,
if (mdfd < 0) {
fprintf(stderr, Name ": failed to open %s: %s.\n",
chosen_name, strerror(errno));
+ map_unlock(&map);
return 2;
}