]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mapfile.c
array_try_spare(): missing map_unlock()
[thirdparty/mdadm.git] / mapfile.c
index be58436c6e3ad78d0627cb3af80a130cbafcac4f..997f0954ecedb8fcd41764384be89c33a45261e9 100644 (file)
--- a/mapfile.c
+++ b/mapfile.c
@@ -159,6 +159,18 @@ void map_unlock(struct map_ent **melp)
        lf = NULL;
 }
 
+void map_fork(void)
+{
+       /* We are forking, so must close the lock file.
+        * Don't risk flushing anything though.
+        */
+       if (lf) {
+               close(fileno(lf));
+               fclose(lf);
+               lf = NULL;
+       }
+}
+
 void map_add(struct map_ent **melp,
            int devnum, char *metadata, int uuid[4], char *path)
 {
@@ -380,7 +392,7 @@ void RebuildMap(void)
                        int dfd;
                        int ok;
                        struct supertype *st;
-                       char *subarray;
+                       char *subarray = NULL;
                        char *path;
                        struct mdinfo *info;
 
@@ -419,7 +431,7 @@ void RebuildMap(void)
                                 *   find a unique name based on metadata name.
                                 *   
                                 */
-                               struct mddev_ident_s *match = conf_match(info, st);
+                               struct mddev_ident *match = conf_match(info, st);
                                struct stat stb;
                                if (match && match->devname && match->devname[0] == '/') {
                                        path = match->devname;