]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Examine.c
__write_init_super_ddf(): Use posix_memalign() instead of static aligned buffer
[thirdparty/mdadm.git] / Examine.c
index c8a44b014f4abc23f8cf0accaa43dea3c5219afe..5d71e537edd3dcd33e035951c34aeb184a22ba86 100644 (file)
--- a/Examine.c
+++ b/Examine.c
@@ -30,7 +30,7 @@
 #endif
 #include       "md_u.h"
 #include       "md_p.h"
-int Examine(mddev_dev_t devlist, int brief, int export, int scan,
+int Examine(struct mddev_dev *devlist, int brief, int export, int scan,
            int SparcAdjust, struct supertype *forcest,
            char *homehost)
 {
@@ -76,11 +76,10 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
                        err = 1;
                }
                else {
-                       unsigned long long size;
                        int container = 0;
                        if (forcest)
                                st = dup_super(forcest);
-                       else if (get_dev_size(fd, NULL, &size) == 0 || size == 0) {
+                       else if (must_be_container(fd)) {
                                /* might be a container */
                                st = super_by_fd(fd, NULL);
                                container = 1;
@@ -88,6 +87,7 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
                                st = guess_super(fd);
                        if (st) {
                                err = 1;
+                               st->ignore_hw_compat = 1;
                                if (!container)
                                        err = st->ss->load_super(st, fd,
                                                                 (brief||scan) ? NULL
@@ -99,6 +99,7 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
                                        if (!err)
                                                have_container = 1;
                                }
+                               st->ignore_hw_compat = 0;
                        } else {
                                if (!brief) {
                                        fprintf(stderr, Name ": No md superblock detected on %s.\n", devlist->devname);
@@ -146,6 +147,7 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
                } else if (export) {
                        if (st->ss->export_examine_super)
                                st->ss->export_examine_super(st);
+                       st->ss->free_super(st);
                } else {
                        printf("%s:\n",devlist->devname);
                        st->ss->examine_super(st, homehost);