]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Query: don't be confused by partition tables.
authorNeilBrown <neilb@suse.de>
Thu, 25 Oct 2012 05:32:00 +0000 (16:32 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 25 Oct 2012 05:32:17 +0000 (16:32 +1100)
Now that we recognise partition tables as a sort of metadata
we need to be careful in --query not to say that a device
with a partition table looks like a device in an array.

Testing ->compare_super for NULL is an easy way to do that.

Signed-off-by: NeilBrown <neilb@suse.de>
Query.c

diff --git a/Query.c b/Query.c
index 0b15e286ea80e690d0f1db9aa3a2f68ac4e4faa1..5676a49ac3958ecf2cfc552c51ff1f9430d9b934 100644 (file)
--- a/Query.c
+++ b/Query.c
@@ -82,7 +82,7 @@ int Query(char *dev)
                       array.spare_disks, array.spare_disks==1?"":"s");
        }
        st = guess_super(fd);
-       if (st)
+       if (st && st->ss->compare_super != NULL)
                superror = st->ss->load_super(st, fd, dev);
        else
                superror = -1;