]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Manage.c
Remove partitions from a device before adding it to an array.
[thirdparty/mdadm.git] / Manage.c
index 7a96d4509a513e9ecda638b93bb04f6baada1b0c..8150be3eaf0fdc7d57d278566053df7f2201e28d 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -306,6 +306,7 @@ int Manage_subdevs(char *devname, int fd,
                                        dv->devname, strerror(errno));
                                return 1;
                        }
+                       remove_partitions(tfd);
                        if (array.not_persistent==0)
                                st->ss->load_super(st, tfd, &osuper, NULL);
                        /* will use osuper later */
@@ -361,7 +362,6 @@ int Manage_subdevs(char *devname, int fd,
                                                close(dfd);
                                                continue;
                                        }
-                                       remove_partitions(dfd);
                                        close(dfd);
                                        break;
                                }