]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-intel.c
detail/wait: better handling of monitoring sync action.
[thirdparty/mdadm.git] / super-intel.c
index 4cebc8da3060c0d28a68ba3d6c043ae8843d7829..38d0ae30550005d7e27fe375b8f622f18af28eb5 100644 (file)
@@ -1705,8 +1705,7 @@ static int update_super_imsm(struct supertype *st, struct mdinfo *info,
        mpb = super->anchor;
 
        if (strcmp(update, "uuid") == 0 && uuid_set && !info->update_private)
-               fprintf(stderr,
-                       Name ": '--uuid' not supported for imsm metadata\n");
+               rv = -1;
        else if (strcmp(update, "uuid") == 0 && uuid_set && info->update_private) {
                mpb->orig_family_num = *((__u32 *) info->update_private);
                rv = 0;
@@ -1727,9 +1726,7 @@ static int update_super_imsm(struct supertype *st, struct mdinfo *info,
        } else if (strcmp(update, "assemble") == 0)
                rv = 0;
        else
-               fprintf(stderr,
-                       Name ": '--update=%s' not supported for imsm metadata\n",
-                       update);
+               rv = -1;
 
        /* successful update? recompute checksum */
        if (rv == 0)
@@ -2199,6 +2196,13 @@ static int load_imsm_mpb(int fd, struct intel_super *super, char *devname)
        __u32 check_sum;
 
        get_dev_size(fd, NULL, &dsize);
+       if (dsize < 1024) {
+               if (devname)
+                       fprintf(stderr,
+                               Name ": %s: device to small for imsm\n",
+                               devname);
+               return 1;
+       }
 
        if (lseek64(fd, dsize - (512 * 2), SEEK_SET) < 0) {
                if (devname)
@@ -5390,7 +5394,7 @@ static void imsm_process_update(struct supertype *st,
                        break;
                }
 
-               snprintf((char *) dev->volume, MAX_RAID_SERIAL_LEN, name);
+               snprintf((char *) dev->volume, MAX_RAID_SERIAL_LEN, "%s", name);
                super->updates_pending++;
                break;
        }