diff options
author | NeilBrown <neilb@suse.de> | 2009-11-17 13:15:34 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-11-17 13:15:34 +1100 |
commit | b42f577a0dbe0b232600478f4a5068b2f63a2684 (patch) | |
tree | fca53e53e4a4df5ea6999c887eee026b22240b58 /super-ddf.c | |
parent | b8ab2a50aba72c7316d92d0fb414167844673136 (diff) | |
download | mdadm-b42f577a0dbe0b232600478f4a5068b2f63a2684.tar.gz mdadm-b42f577a0dbe0b232600478f4a5068b2f63a2684.tar.xz mdadm-b42f577a0dbe0b232600478f4a5068b2f63a2684.zip |
Improve error messages when metadata handler does not support request.
->validate_geometry is called to validate overall parameters,
and to validate each individual device.
If it ever fails, it needs to report the reason, as common code
cannot possible know.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r-- | super-ddf.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/super-ddf.c b/super-ddf.c index 80df570..fe83642 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -2555,8 +2555,12 @@ static int validate_geometry_ddf(struct supertype *st, for (i=0; ddf_level_num[i].num1 != MAXINT; i++) if (ddf_level_num[i].num2 == level) break; - if (ddf_level_num[i].num1 == MAXINT) + if (ddf_level_num[i].num1 == MAXINT) { + if (verbose) + fprintf(stderr, Name ": DDF does not support level %d arrays\n", + level); return 0; + } /* Should check layout? etc */ if (st->sb && freesize) { @@ -2604,7 +2608,7 @@ static int validate_geometry_ddf(struct supertype *st, if (verbose) fprintf(stderr, Name ": ddf: Cannot create this array " - "on device %s\n", + "on device %s - a container is required.\n", dev); return 0; } @@ -2696,8 +2700,11 @@ static int validate_geometry_ddf_bvd(struct supertype *st, struct extent *e; int i; /* ddf/bvd supports lots of things, but not containers */ - if (level == LEVEL_CONTAINER) + if (level == LEVEL_CONTAINER) { + if (verbose) + fprintf(stderr, Name ": DDF cannot create a container within an container\n"); return 0; + } /* We must have the container info already read in. */ if (!ddf) return 0; |