summaryrefslogtreecommitdiffstats
path: root/super0.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-07-12 20:27:38 +1000
committerNeil Brown <neilb@suse.de>2008-07-12 20:27:38 +1000
commitf7e7067b47d2ca9994f9222dfa5833ac84ce3b22 (patch)
tree9519e435af3001dd2ccb2ee01d114067213aa615 /super0.c
parent6adfd3affda071d1083497d150a1150ade0e3fdb (diff)
downloadmdadm-f7e7067b47d2ca9994f9222dfa5833ac84ce3b22.tar.gz
mdadm-f7e7067b47d2ca9994f9222dfa5833ac84ce3b22.tar.xz
mdadm-f7e7067b47d2ca9994f9222dfa5833ac84ce3b22.zip
Add subarray field to supertype.
When loading the metadata for a subarray (super_by_fd), we set ->subarray to be the name read from md/metadata_version so that getinfo_super can return info about the correct array. With this we can differentiate between a container and an array within the container by looking at ->subarray[0].
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/super0.c b/super0.c
index 6bb5a7e..9984712 100644
--- a/super0.c
+++ b/super0.c
@@ -783,6 +783,9 @@ static int load_super0(struct supertype *st, int fd, char *devname)
free_super0(st);
+ if (st->subarray[0])
+ return 1;
+
if (!get_dev_size(fd, devname, &dsize))
return 1;