]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Add warnings if we ever fail to get a lock on the mapfile.
authorDoug Ledford <dledford@redhat.com>
Tue, 20 Jul 2010 21:42:26 +0000 (17:42 -0400)
committerDoug Ledford <dledford@redhat.com>
Thu, 22 Jul 2010 14:16:31 +0000 (10:16 -0400)
Signed-off-by: Doug Ledford <dledford@redhat.com>
Incremental.c

index 35490e764a9dbf524c1d2af7f7adc8c0b5812b23..a8a072d438b209212b4b3299908c5e556944ac35 100644 (file)
@@ -294,7 +294,9 @@ int Incremental(char *devname, int verbose, int runstop,
 
        /* 4/ Check if array exists.
         */
-       map_lock(&map);
+       if (map_lock(&map))
+               fprintf(stderr, Name ": failed to get exclusive lock on "
+                       "mapfile\n");
        mp = map_by_uuid(&map, info.uuid);
        if (mp)
                mdfd = open_dev(mp->devnum);
@@ -793,7 +795,9 @@ int Incremental_container(struct supertype *st, char *devname, int verbose,
        struct mdinfo *ra;
        struct map_ent *map = NULL;
 
-       map_lock(&map);
+       if (map_lock(&map))
+               fprintf(stderr, Name ": failed to get exclusive lock on "
+                       "mapfile\n");
 
        for (ra = list ; ra ; ra = ra->next) {
                int mdfd;