summaryrefslogtreecommitdiffstats
path: root/Create.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-07-12 20:28:38 +1000
committerNeil Brown <neilb@suse.de>2008-07-12 20:28:38 +1000
commitf7f1b6a1dbdce3df1fb5408991f8bf364a612f15 (patch)
tree923596833131cefe441d57eebad7943fe818600e /Create.c
parent77472ff8d0a7e72b2da72c05dbbe1bf1adc0f2ca (diff)
downloadmdadm-f7f1b6a1dbdce3df1fb5408991f8bf364a612f15.tar.gz
mdadm-f7f1b6a1dbdce3df1fb5408991f8bf364a612f15.tar.xz
mdadm-f7f1b6a1dbdce3df1fb5408991f8bf364a612f15.zip
Print used message in place of "default metadata" message.
When creating an array in a container, print e.g. Creating array inside ddf container /dev/whatever rather than Defaulting to version /md127/1 metadata
Diffstat (limited to 'Create.c')
-rw-r--r--Create.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/Create.c b/Create.c
index 8abc299..bef221a 100644
--- a/Create.c
+++ b/Create.c
@@ -520,9 +520,27 @@ int Create(struct supertype *st, char *mddev, int mdfd,
total_slots = info.array.nr_disks;
st->ss->getinfo_super(st, &info);
- if (did_default)
- fprintf(stderr, Name ": Defaulting to version"
- " %s metadata\n", info.text_version);
+ if (did_default && verbose >= 0) {
+ if (info.text_version[0] == '/') {
+ int dnum = devname2devnum(info.text_version+1);
+ char *path;
+ int mdp = get_mdp_major();
+ struct mdinfo *mdi;
+ if (dnum > 0)
+ path = map_dev(MD_MAJOR, dnum, 1);
+ else
+ path = map_dev(mdp, (-1-dnum)<< 6, 1);
+
+ mdi = sysfs_read(-1, dnum, GET_VERSION);
+
+ fprintf(stderr, Name ": Creating array inside "
+ "%s container %s\n",
+ mdi?mdi->text_version:"managed", path);
+ sysfs_free(mdi);
+ } else
+ fprintf(stderr, Name ": Defaulting to version"
+ " %s metadata\n", info.text_version);
+ }
if (bitmap_file && vers < 9003) {
major_num = BITMAP_MAJOR_HOSTENDIAN;