summaryrefslogtreecommitdiff
path: root/super1.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
commit2c514b7120a5e58cf803c854c047de03bd774730 (patch)
treea7c97aeb88519ebf9520285c83e80b1d482cdcaf /super1.c
parent047d2e49f52a25cc88781d11cd83e147791975d6 (diff)
downloadmdadm-2c514b7120a5e58cf803c854c047de03bd774730.tar.gz
Pass 'verbose' flag to validate_geometry
That way it can be silent when we are just trying to figure out which metadata to use, and noisy when detecting a real problem.
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/super1.c b/super1.c
index 507e418..06d0a18 100644
--- a/super1.c
+++ b/super1.c
@@ -1465,7 +1465,8 @@ static void free_super1(struct supertype *st)
static int validate_geometry1(struct supertype *st, int level,
int layout, int raiddisks,
int chunk, unsigned long long size,
- char *subdev, unsigned long long *freesize)
+ char *subdev, unsigned long long *freesize,
+ int verbose)
{
unsigned long long ldsize;
int fd;
@@ -1477,10 +1478,12 @@ static int validate_geometry1(struct supertype *st, int level,
fd = open(subdev, O_RDONLY|O_EXCL, 0);
if (fd < 0) {
- fprintf(stderr, Name ": Cannot open %s: %s\n",
- subdev, strerror(errno));
+ if (verbose)
+ fprintf(stderr, Name ": super1.x cannot open %s: %s\n",
+ subdev, strerror(errno));
return 0;
}
+
if (!get_dev_size(fd, subdev, &ldsize)) {
close(fd);
return 0;