summaryrefslogtreecommitdiffstats
path: root/Examine.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-11-22 10:58:06 +0100
committerNeilBrown <neilb@suse.de>2010-11-22 10:58:06 +0100
commit3a3716107b614f679a4ea224e5bb882739d81cf9 (patch)
tree7874c3cc38822e3ca4e3af9909d3c7278d73ae63 /Examine.c
parentAssemble: turn next_member goto loop into a for loop. (diff)
downloadmdadm-3a3716107b614f679a4ea224e5bb882739d81cf9.tar.xz
mdadm-3a3716107b614f679a4ea224e5bb882739d81cf9.zip
Add must_be_container helper.
This checks a block device to see if it could be a container, and in particular cannot be a member device. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Examine.c')
-rw-r--r--Examine.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Examine.c b/Examine.c
index 3c1e73f9..ffca9ca5 100644
--- a/Examine.c
+++ b/Examine.c
@@ -76,11 +76,10 @@ int Examine(struct mddev_dev *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;